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.
|