LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 11-15-2010, 05:57 AM   #1
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,710
Blog Entries: 29

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Width of the computer screen


Is there a limit to the number of characters that get shown on the screen ? Or it all depends on the font size ?
 
Old 11-15-2010, 07:11 AM   #2
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
I would think that the only *virtual* limit would be how many characters can fit into (video?) memory (and nowadays, that's a ridiculous amount). I would say that you could probably have a full-screen framebuffer terminal with a tiny 4 pt. font on a 1280x1024 screen (or something like that) and still have it work just fine.

..but of course there's the DPI of the display to take into account, too.
 
Old 11-15-2010, 10:03 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Typically a console has a 80-characters width, but it can be extended to 132 depending on the VGA/VESA video mode used. It depends on the capability of your video-card and on what modes are supported. In other words you cannot choose any combination of rows x columns size. To see which modes are available for you graphic card, you can try to set vga=ask among the boot parameters. Then at reboot you will be prompted to scan for available modes and it will show a list of available column x rows sizes together with the octal code of the related video mode. Nowadays a common choice for video mode is vga=791 which means a resolution of 1024x768 and 16-bit colors. On my monitor it brings to a console size of 128 x 48 characters.
 
Old 11-15-2010, 10:05 PM   #4
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,710

Original Poster
Blog Entries: 29

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Thanks to both of you.

and colucix, you gave a great explanation.

Thanks again.
 
Old 11-18-2010, 04:14 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,710

Original Poster
Blog Entries: 29

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Can we somehow determine through a program the set width of a screen ? since you said that "typically" a comp screen has 80 char width and it can be "extended" !
 
Old 11-18-2010, 04:43 AM   #6
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
You can get the width using echo $COLUMNS. Not sure about height, though.
 
Old 11-18-2010, 04:45 AM   #7
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,710

Original Poster
Blog Entries: 29

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Thanks Mr. Code,
Code:
anisha@linux-uitj:~> echo $COLUMNS
105
Does this mean that 105 chars can be displayed on my screen horizontally ?
 
Old 11-18-2010, 06:39 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
Quote:
Originally Posted by anishakaul View Post
Does this mean that 105 chars can be displayed on my screen horizontally ?
Yes. You can test by creating a two line file called ruler:
Code:
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
         1         2         3         4         5         6         7         8         9         10        11        12        13        14        15        16        17
and then, in a resizeable terminal emulator
Code:
PS1=
echo $COLUMNS
cat ruler
the resizing the window and repeating the last two commands.
 
Old 11-18-2010, 06:47 AM   #9
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,811
Blog Entries: 58

Rep: Reputation: Disabled
I've got more columns than you, Anisha!
Code:
brian@SlackB:~$ echo $COLUMNS
180
or:
Code:
bash-4.1$ echo $COLUMNS
156

Last edited by brianL; 11-18-2010 at 06:52 AM.
 
Old 11-18-2010, 07:00 AM   #10
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,710

Original Poster
Blog Entries: 29

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Thanks for the effort, Charles.

You meant to tell me that $COLUMNS is changeable at the run time ? What was that PS1 ? Ctrl-c didn't work after that, I had to press Ctrl-d to get out.

You must have a wide screen LCD, Brian..

Last edited by TheIndependentAquarius; 02-17-2015 at 12:57 AM.
 
Old 11-18-2010, 07:03 AM   #11
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
@brianL

Mine comes close when I have Terminal maximized :

Code:
[mrcode@lappy486 ~]$ echo $COLUMNS
169
EDIT: More on-topic:

Quote:
Originally Posted by anishakaul
You meant to tell me that $COLUMNS is changeable at the run time ?
If you're using a terminal emulator, yes. If you're using a framebuffer console, no (at least I don't think).

EDIT EDIT: One last thing: another + to Compiz is that the "Window Resize Info" plugin shows the size of a terminal window in characters, not pixels, so I always know how big it is in chars without having to check $COLUMNS etc.

Last edited by MrCode; 11-18-2010 at 07:09 AM.
 
Old 11-18-2010, 07:09 AM   #12
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,811
Blog Entries: 58

Rep: Reputation: Disabled
Quote:
Originally Posted by anishakaul View Post
You must have a wide screen LCD, Brian..
No, it's a 4:3, 19", 1280x1024.
 
Old 11-18-2010, 07:13 AM   #13
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,811
Blog Entries: 58

Rep: Reputation: Disabled
Quote:
Originally Posted by MrCode View Post
@brianL

Mine comes close when I have Terminal maximized :

Code:
[mrcode@lappy486 ~]$ echo $COLUMNS
169
Yeah, that 180 of mine was from Konsole maximised.
 
Old 11-18-2010, 07:21 AM   #14
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by brianL
No, it's a 4:3, 19", 1280x1024.
1280x1024 is 5:4, actually. The 4:3 equivalent would be 1280x960.
 
Old 11-18-2010, 07:27 AM   #15
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,811
Blog Entries: 58

Rep: Reputation: Disabled
Ooops! brianL is wrong again! Yes, it is a 5:4 monitor.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] maximized window larger than screen width rusyd Linux - Desktop 2 08-24-2010 01:07 AM
Screen width problem on widescreen TV Arla Linux - Desktop 7 02-18-2007 06:45 AM
Trying to get width and hieght of screen in characters Cynagen Linux - General 1 07-28-2006 09:54 AM
Laptop Screen Height and Width blueStatic Linux - Hardware 1 09-03-2003 01:06 AM
Red Hat, non X, screen width. DiBosco Linux - General 6 01-19-2002 11:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration