getty 64 char limit per line?

Denys Vlasenko vda.linux at googlemail.com
Fri Apr 25 18:30:41 UTC 2008


On Friday 25 April 2008 19:38, Shane Volpe wrote:
> Screen Text:
> I typed in root at endor:~#
> 1234567890123456789012345678901234567890123456789012345678901234
> 
> "123456789012345678901234567890123456789012345678901234567890123" is
> the point right after the cursor jumped up to the line above.
> below is what happened
> root at endor:~# strace -o strace.log ash
> ptrace: umoven: Input/output error
> ash: 123456789012345678901234567890123456789012345678901234567890123: not found
> 
> Attached is the strace log.

Well, you forgot to exit and strace contains much more than that :)

It contains "ifconfig" and other commands you typed:

write(1, "root at endor:~# ", 16)        = 16
read(0, "i", 1)                         = 1
write(1, "i", 1)                        = 1
read(0, "f", 1)                         = 1
write(1, "f", 1)                        = 1
read(0, "c", 1)                         = 1
write(1, "c", 1)                        = 1
read(0, "o", 1)                         = 1
write(1, "o", 1)                        = 1
read(0, "n", 1)                         = 1
write(1, "n", 1)                        = 1
read(0, "f", 1)                         = 1
write(1, "f", 1)                        = 1
read(0, "i", 1)                         = 1
write(1, "i", 1)                        = 1
read(0, "g", 1)                         = 1
write(1, "g", 1)                        = 1
read(0, "\n", 1)                        = 1
write(1, "\n", 1)                       = 1

Anyway. Here is you making your test:

write(1, "root at endor:~# ", 16)        = 16
	16 chars are printed
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
...
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
	10 more
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
...
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
	10 more
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
...
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
	10 more
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
...
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
	10 more
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
...
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
	10 more
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
...
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
	10 more, 76 total
read(0, "1", 1)                         = 1
write(1, "1", 1)                        = 1
read(0, "2", 1)                         = 1
write(1, "2", 1)                        = 1
read(0, "3", 1)                         = 1
write(1, "3", 1)                        = 1
read(0, "4", 1)                         = 1
write(1, "4 \10", 3)                    = 3

This last "4" was 80th char. ash thinks you have 80 char display,
so it prints extra space (to move cursor to next line) and then backspace.

But your screen is wider, and in reality it does not happen!

read(0, "5", 1)                         = 1
write(1, "5", 1)                        = 1
read(0, "6", 1)                         = 1
write(1, "6", 1)                        = 1
read(0, "7", 1)                         = 1
write(1, "7", 1)                        = 1
read(0, "8", 1)                         = 1
write(1, "8", 1)                        = 1
read(0, "9", 1)                         = 1
write(1, "9", 1)                        = 1
read(0, "0", 1)                         = 1
write(1, "0", 1)                        = 1
read(0, "\177", 1)                      = 1
write(1, "\10 \10", 3)                  = 3
read(0, "\177", 1)                      = 1
write(1, "\10 \10", 3)                  = 3
read(0, "\177", 1)                      = 1
write(1, "\10 \10", 3)                  = 3
read(0, "\177", 1)                      = 1
write(1, "\10 \10", 3)                  = 3
read(0, "\177", 1)                      = 1
write(1, "\10 \10", 3)                  = 3
read(0, "\177", 1)                      = 1
write(1, "\10 \10", 3)                  = 3
read(0, "\177", 1)                      = 1
write(1, "\r\33[1A\33[79C  \10\r\33[1A\33[79C", 23) = 23

and here ash thinks that you reached 1st column and moves cursor one line up.

The solution is to properly set COLUMNS env variable,
or to use terminal emulator which correctly passes back
screen size information.

ssh protocol does it better than telnet, one more reason
to stop using telnet! ;)

Failing that, attached patch may help a bit, but I'm sure
there is more of this breakage. For example left-right arrows
amy misbehave even after this patch.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7.patch
Type: text/x-diff
Size: 1068 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080425/0b80cd9d/attachment.bin 


More information about the busybox mailing list