Changes between Version 17 and Version 18 of serial


Ignore:
Timestamp:
09/05/2019 03:50:13 PM (5 years ago)
Author:
Tim Harvey
Comment:

fixed typos

Legend:

Unmodified
Added
Removed
Modified
  • serial

    v17 v18  
    671671console applications running inside Linux virtual terminal applications (xterm, rxvt etc) will receive SIGWINCH after a resize operation has taken place and adjust accordingly.
    672672
    673 When using a serial console there is no such mechanism and you can see the affect of this by connecting to a serial console (ie jtag_com/jtag_gang) and showing your size either via env vars or via the 'stty size' app:
     673When using a serial console there is no such mechanism and you can see the affect of this by connecting to a serial console and showing your size either via env vars or via the 'stty size' app:
    674674{{{#!bash
    675675~# echo $LINES $COLUMNS
     
    681681No matter how you resize that virtual terminal window (ie xterm), the above commands will always report the same size.
    682682
    683 It is possible for the application to actively ask for the current console window size so the second best thing is to do this every time a command prompt is printed by the shell. This can be achieved by sending a ANSI code to position the cursor to 999,999 then request the cursor position.
    684 
    685 The 'resize' app from the 'xterm' package does this, but here is also a cleaner version with less dependencies:
     683It is possible for the application to actively ask for the current console window size. This can be achieved by sending a ANSI code to position the cursor to 999,999 then request the cursor position.
     684
     685The {{{resize}}} app from the {{{xterm}}} package does this, but here is also a cleaner version with less dependencies:
    686686{{{#!bash
    687687wget http://web.archive.org/web/20081224152013/http://www.davehylands.com/gumstix-wiki/resize/resize.c
     
    689689}}}
    690690
    691 You can also do this with shell scripts that do the same thing:
     691You can also do this with a shell script that do the same thing:
    692692{{{#!bash
    693693resize() {
     
    702702}}}
    703703
    704 you could add this and the following to your /etc/bash.bashrc:
     704you could add this and the following to your {{{/etc/bash.bashrc}}} so that the console size is detected and adjusted on login:
    705705{{{#!bash
     706# IMX6 serial console
    706707[[ "$(tty)" =~ "/dev/ttymxc" ]] && { resize; }
    707 }}}
    708 
    709 some people also opt to use the 'trap' shell function to execute it on every command:
     708# Newport serail console
     709[[ "$(tty)" =~ "/dev/ttyAMA" ]] && { resize; }
     710}}}
     711
     712Some people also opt to use the 'trap' shell function to execute it on every command in order to adjust continually:
    710713{{{#!bash
     714# IMX6 serial console
    711715[[ "$(tty)" =~ "/dev/ttymxc" ]] && { trap resize DEBUG; }
     716# Newport serail console
     717[[ "$(tty)" =~ "/dev/ttyAMA" ]] && { trap resize DEBUG; }
    712718}}}
    713719