LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2011, 05:06 PM   #1
crunchytheory
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
How is text directed to the command-line as you type?


For background, I'm trying to fix a bug in my embedded linux system. I'm using Minicom in Ubuntu to access the device's console via serial UART. When entering a long command, after 80 characters total (including the prompt) the cursor will jump to the beginning of the same line and overwrite the prompt and what I've already entered, rather than jump to the next line The buffer is preserved and the command will execute fine, but the text that's displayed is overwritten.

For example:

$ cat "xxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1" > thisisatest.txt

Will look like:

thisisatest.txtxxxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1xxxxxxxx1" >

I've asked this before, and some have suggested that it's a mismatch between the terminal emulators, but my embedded and system and Minicom are both set to use vt102. And this issue occurs with any Windows terminal applications as well. I don't see the problem when logging into the embedded system via telnet.

Theories are very welcome, but I'm mainly asking for information on how what you type is displayed on the command-line as you're typing. Suggestions for where to look in the source would work, too. I don't know if this is handled by the shell (Bash, in this case), or at a lower level by the kernel (maybe stdin is directed to stdout by default somehow), or at the hardware level as a serial device thing. So I'm not sure where to look.

I've read material on standard I/O, but I've only been able to find stuff on how the shell executes commands after you hit ENTER. But nothing about how the text is displayed before you hit ENTER.
 
Old 10-25-2011, 07:03 PM   #2
spankbot
Member
 
Registered: Aug 2007
Posts: 131

Rep: Reputation: 16
"By default, minicom will not wrap longs lines of text, which causes them to run off the edge of your terminal screen. To avoid this, use the '-w' command line option. See 'man minicom' for more information. "

The above quote is from http://elinux.org/Minicom

Was this helpful?
 
Old 10-25-2011, 07:30 PM   #3
crunchytheory
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spankbot View Post
"By default, minicom will not wrap longs lines of text, which causes them to run off the edge of your terminal screen. To avoid this, use the '-w' command line option. See 'man minicom' for more information. "

The above quote is from http://elinux.org/Minicom

Was this helpful?
Thanks for the reply. It's not a problem with Minicom as it readily displays kernel stdout to the full width of the window and other Windows terminal applications (e.g. TeraTerm, SecureCRT, Hyperterm) behave the same way. So it must be the embedded device. This problem is exclusive to entering commands before you hit ENTER, and nowhere else. It's very strange. I keep thinking it has to do with stdin, but the 80 character limit before the wrap includes my "# " prompt which doesn't come from the keyboard.
 
Old 10-26-2011, 02:31 PM   #4
crunchytheory
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Anyone? Maybe it sounded like I was asking someone to solve my problem. I'm really just asking for a pointer to where to look in the source or online for how what you're typing gets to the screen.
 
  


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
make the command line you type invisible sulekha Linux - Security 1 07-02-2010 08:52 AM
What to type in command line durring the first boot? cimek Linux - Newbie 7 11-25-2008 07:17 AM
Random file lines directed to a new file. In script an error. In command line no err leventis Programming 1 09-28-2006 08:16 AM
command line for determining memory type jdier Linux - Newbie 1 06-10-2004 10:00 AM
file type from command line?? wr3ck3d Linux - General 4 03-12-2003 02:48 PM


All times are GMT -5. The time now is 04:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration