Friday, March 19, 2010

IOS: Setting Terminal Window Length

September 10, 2009 by Greg Ferro · 1 Comment 

This Post is Part of a Series — click for list on Console Mastery»

Some Roots

Cisco IOS has it’s roots in some very old tech­no­lo­gies. As such, it tends to have some funny ideas about things if you are new to using Cisco IOS. When you tel­net /​ SSH to a router, it always dis­plays the con­fig­ur­a­tion with 80 char­ac­ters left to right, and 24 lines of char­ac­ters from top to bot­tom. This goes to back to the olden days of char­ac­ter based ter­min­als and the BSD of the day.

Wyse 50 serial console terminal (Credit:Wikipedia)

Wyse 50 serial con­sole ter­minal — ahh memor­ies! (Credit:Wikipedia)

Console or Terminal

I use the word ter­minal and con­sole as sep­ar­ate terms.

Console describes the serial port on your router
Terminal describes a tel­net or SSH ses­sion to your router
Terminal Emulator Software pack­age that emu­lates a ter­minal (such as that above) and can be used to con­nect to the Console (with a serial cable) or make a tel­net /​ SSH connection.

Since you can “con­sole or ter­minal” to a router, it’s typ­ical for most engin­eers to say “con­sole or ses­sion” to the router.

24 lines is NOT enough

When you are con­stantly typ­ing ‘show run’ to get the con­fig on your Cisco con­sole /​ ter­minal  you might notice that only 24 lines are shown before you need to press space to make it continue:

Terminal Session is only 24 lines long - aaarrgh

Terminal Session is only 24 lines long — aaarrgh

If you spend a lot of time at the con­sole, like me, you might find this a bit annoy­ing. A mod­ern com­puter with a small but read­able font can eas­ily get sixty or more lines.

Adjust your Terminal

The Cisco IOS con­sole has a couple of switches that you use to fix this.

Terminal Length — Temporary

For the cur­rent con­sole ses­sion you can simply type

term len 60

and for the remainder of the ses­sion that you are logged in, the win­dow will always dis­play sixty lines.

60 lines of Glorious Viewing Pleasure

60 lines of Glorious Viewing Pleasure

TIP:Best Starting Length

For most ter­minal pro­grams (Putty, SecureCRT etc) a good start­ing length is 40 lines. This is because the default screen fonts used on Windows and Linux tend to work out to forty lines for a full length screen.1

Best of use of ter­minal length ?

The very best use of ter­minal length is when you want to dump a whole pile of inform­a­tion to your screen. You might want to copy it into a text file to send to me to ana­lyse, or save the con­fig­ur­a­tion and some show com­mands for future ref­er­ence. But you don’t want to have to keep press­ing the space bar over and over.

ter­minal length 0

and to set it it back

ter­minal length 40

Terminal Length — Permanent

If you want to set this to a default for every future IOS ter­minal ses­sion then do the following:

Router#conf t
Enter con­fig­ur­a­tion com­mands, one per line. End with CNTL/​Z.
Router(config)#line vty 04
Router(config-line)#len
Router(config-line)#length ?
<0 – 512> Number of lines on screen (0 for no pausing)

Router(config-line)#length 40

Checking the Configured Terminal Length

Router#sh ter­minal
Line 0, Location: “”, Type: ““
Length: 0 lines, Width: 80 columns
Status: PSI Enabled, Ready, Active, Automore On
Capabilities: none
Modem state: Ready

—-SNIP — -

No spe­cial data dis­patch­ing char­ac­ters
Router#

Should you do this ?

Setting the ter­minal length to forty lines is prob­ably accept­able in most net­works but not longer. You can’t always be sure what ter­minal emu­lator you might use in an emer­gency so keep it smal­ler rather than larger.

Console — should you set it ?

Note that the con­sole per­man­ent set­tings is slightly dif­fer­ent. I would recom­mend against this. The con­sole is your emer­gency con­nec­tion and you really want it to work.

Router#conf t
Enter con­fig­ur­a­tion com­mands, one per line. End with CNTL/​Z.
Router(config)#line con­sole 0
Router(config-line)#leng
Router(config-line)#length ?
<0 – 512> Number of lines on screen (0 for no pausing)

Router(config-line)#length

Wrap Up

I will con­tinue to post more art­icles in a series on Console Mastery over the next few weeks since there has been a hot response to the last few. If you have any tips you want to see here, don’t hes­it­ate to leave a com­ment or email me: myether­e­al­mind —at– gmail dot com — I’m sure that there are really clever people out there who know stuff that I don’t.

Footnotes

  1. Look for an upcom­ing post on screen fonts and some recom­mend­a­tions. [back]

Please rate this post:

  Why Rate Posts?
1 Star - It\\\'s Crud2 Stars - It\\\'s Tosh3 Stars - Something\\\'s missing4 Stars - Needs works5 Stars - Good Enough6 Stars - Good7 Stars - Excellent8 Stars - Brilliant9 Stars - Astonishing10 Stars - Awesomely Godlike? (1 votes, average: 5.00 out of 10)
Loading ... Loading ...

Comments

One Response to “IOS: Setting Terminal Window Length”
  1. You could also use

    puts [exec “command”]

    in tclsh to work around pagin­a­tion. The ulti­mate hack is prob­ably a tclsh script that you run through an alias :) .

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!