LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-14-2010, 09:41 AM   #1
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: Arch, Debian
Posts: 193

Rep: Reputation: 16
Serial terminal emulation - bad row column count ?


Hello,

I connect to linux using serial cable from windows machine.
I use putty as serial terminal emulator.

Everything works fine except programs which scroll text - man, more, less, vi, etc.. These programs asumme my terminal size is 80cols x 24rows (my putty window size is more than that, and I resize putty window sometimes)
The cause of this is that putty does not transfer cols rows count correctly:
Code:
# stty -a
speed 38400 baud; rows 0; columns 0; line = 0;
So programs use default 80x24 because actual col/row settings are zeros.
In contrast if I use the same putty(same settings) but ssh connection - I can clearly see how col/row settings change when I resize my putty window - and col/row numbers are correct. (so maybe not putty's fault?)

Anyway workaroud would be to freeze putty window size and insert stty command into startup scripts which sets correct col/row sizes of current putty window (I will be unable to resize putty window in this case).

Anyone knows the way to configure putty(serial connection) to transfer correct col/rows to linux even when putty window is resized dynamically - like using putty ssh?

thnaks
Vilius
 
Old 06-14-2010, 11:56 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
How about using a different terminal emulator? I've always found Kermit to have excellent emulation characteristics, although I haven't used it under Windows since Win95/98.
--- rod.
 
Old 06-14-2010, 08:25 PM   #3
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: Arch, Debian
Posts: 193

Original Poster
Rep: Reputation: 16
Well looks like all of them behave the same way - tried tera term, kermit..
I want to ask simpler question -

Is there a way to set linux stty rows and columns settings using terminal emulator settings, before serial connection is made ?
(I'm only asking this because ssh client terminals(the same putty) handles rows and columns right)

thanks
V

Last edited by Vilius; 06-14-2010 at 08:28 PM.
 
Old 06-15-2010, 09:01 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I don't think serial terminals can communicate rows/columns sizes 'on-the-fly'. Remember that they are emulating hardware terminals, where the terminal characteristics are fixed. As such, the row/colum sizes are derived/inferred from the value of $TERM.
Are you connecting to a getty-ish process (ie. logging in) or simply connecting to an existing process that is driving the serial port? My belief is that getty sets the value of rows & cols from either the $TERM variable or from an argument provided by init. Thereafter, you can only change this by using stty or equivalent.
--- rod.
 
  


Reply



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
[ask awk] remove certain row in a column dhodho Programming 18 06-08-2010 09:36 AM
DBD::mysql::st execute failed: Column count doesn't match value count at row 1 shifter Programming 2 02-24-2010 07:42 PM
gnome-terminal is missing one pixel row and its an important row rednuht Linux - General 1 12-24-2009 10:30 AM
transpose row to column? resolute155 Programming 3 09-07-2009 02:29 PM
Transposing a column into a row mayyash Linux - General 1 09-30-2005 02:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:13 AM.

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