42.6 Screen Size Testing FilesHow many lines and columns are there on your screen or window? The answer can be important to some programs ( 42.5 ) . I've got a directory named testing_files with a few files I've developed to test and set screen sizes. 42.6.1 Single Line Screen Width: 80cols
Figure 42.1: The 80cols FileThe pattern repeats every ten characters, making it easy to count how many columns the window has. Some UNIX programs are set for 80-column screens - even if you can make wider windows, you may not want to. If you want other widths, you can make cols files for them, too. 42.6.2 Screen Width and Height: screensize
Figure 42.2: Checking Window Height and Width with screensizeIn Figure 2, the top number is 9. So, the window has 10 lines (counting the prompt on the last line).
The
screensize
file is also handy
with a full-screen application like
more
(
25.3
)
to see if the
right number of lines and columns are displayed.
When
more
shows the first screenful, the line labeled The same thing should work with editors like vi . 42.6.3 Set Width, Test Line Wrapping: longlines
Figure 42.3: Using longlines File with the Emacs EditorOn an 80-column screen, if line wrapping is working right, each line of longlines should take exactly two and one-half lines to display. (If you're using Emacs, remember that because it adds a backslash at the line break, the third part of each line will have two more characters.) As the previous figure shows, there shouldn't be any missing numbers or blank lines. If you're using a windowing system like X ( 1.31 ) , look for a resize or window info function. For example, in the X Window System, the twm window manager will show a small box with the window dimensions as you hold down the mouse button to resize a window. You don't have to resize the window; just look at the size-box. The X command xwininfo gives lots of information-including the window size in pixels. - |
|