On February 06 2005 09:16, you wrote: > The test file is displayed without troubles here. I'm testing with > konsole and $TERM=xterm.
I also have $TERM=xterm > What does "ls -l /dev/tty" show? Do you have other programs that behave > strangely? $ ls -l /dev/tty crw-rw-rw- 1 root tty 5, 0 Feb 6 09:29 /dev/tty As far as I can tell, less is the only program on my machine behaving strangely. Also, if I ssh into another machine from mine, less seems to work correctly, while the opposite does not work (ssh to my machine from another). I also downloaded and compiled less-382, and it works just fine. > Besides that, maybe strace shows something... I've attached the output of strace, but I suspect you may not find anything interesting in it because the problem seems to go away when I run less through strace. I used this command: strace less testfile 2>less.strace > > Thomas > > Luke Campagnola wrote: > > On February 02 2005 06:43, you wrote: > >>-S really should make a visible difference > > > > None whatsoever. > > > >>Is this happining on all files as soon as they contain lines longer than > >>then screen or do some work and some don't? What is the simplest file it > >>happens on? > > > > As an example, I have written a file that consists of 40 lines of > > "abcdefghijklmnopqrstuvwxyz0123456789" > > > > If I make my console window very small - 26x12 (to cause wrapping, and > > such that it fits nicely in an e-mail) and view this file in less, I see: > > > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > > > This looks ok. Now I'll press the down arrow once, then the up arrow > > once. Here's what I see: > > > > abcdefghijklmnopqrstuvwxyz > > 0123456789klmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > > > Now if I press the down arrow again, I see this: > > > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > abcdefghijklmnopqrstuvwxyz > > abcdefghijklmnopqrstuvwxyz > > 0123456789 > > > >>Do you have any environment variables or configuration files that affect > >>less' behavior? Like ~/.less, $LESS, $LESSOPEN? > > > > No ~/.less file, and no variables with "LESS" in them. The problem exists > > in both xterm, konsole, and on a plain console. I also noticed that when > > less first opens this kind of file, it displays too many lines. For > > instance, in the example above, less tried to display the first 12 lines, > > even though there was only room for 6 since the lines were wrapped > > around. > > > > Luke
execve("/usr/bin/less", ["less", "tmp/testfile"], [/* 21 vars */]) = 0 uname({sys="Linux", node="rock", ...}) = 0 brk(0) = 0x8063000 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.preload", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=19, ...}) = 0 old_mmap(NULL, 19, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x40018000 close(3) = 0 open("/lib/libsafe.so.2", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\24\24\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=18676, ...}) = 0 old_mmap(NULL, 21808, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40019000 old_mmap(0x4001e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x4000) = 0x4001e000 close(3) = 0 munmap(0x40018000, 19) = 0 open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=101204, ...}) = 0 old_mmap(NULL, 101204, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4001f000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/usr/lib/libncurses.so.5", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\342"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=252592, ...}) = 0 old_mmap(NULL, 257868, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40038000 old_mmap(0x4006e000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x35000) = 0x4006e000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340X\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=1279300, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40077000 old_mmap(NULL, 1289612, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40078000 old_mmap(0x401a8000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12f000) = 0x401a8000 old_mmap(0x401b1000, 7564, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x401b1000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/libdl.so.2", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\32"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=9432, ...}) = 0 old_mmap(NULL, 12288, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x401b3000 old_mmap(0x401b5000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x401b5000 close(3) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x401b6000 set_thread_area({entry_number:-1 -> 6, base_addr:0x401b6080, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 munmap(0x4001f000, 101204) = 0 readlink("/proc/self/exe", "/usr/bin/less", 4095) = 13 brk(0) = 0x8063000 brk(0x8084000) = 0x8084000 open("/etc/libsafe.exclude", O_RDONLY) = -1 ENOENT (No such file or directory) ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 access("/home/lcampagn/.terminfo/x/xterm", R_OK) = -1 ENOENT (No such file or directory) access("/etc/terminfo/x/xterm", R_OK) = 0 open("/etc/terminfo/x/xterm", O_RDONLY) = 3 read(3, "\32\1\34\0\35\0\17\0\235\1\226\4", 12) = 12 read(3, "xterm|X11 terminal emulator\0", 28) = 28 read(3, "\0\1\0\0\1\0\0\0\1\0\0\0\0\1\1\0\0\0\0\0\0\0\1\0\0\1\0"..., 29) = 29 read(3, "\0", 1) = 1 read(3, "P\0\10\0\30\0\377\377\377\377\377\377\377\377\377\377\377"..., 30) = 30 read(3, "\0\0\4\0\6\0\10\0\31\0\36\0&\0*\0.\0\377\3779\0J\0L\0P"..., 826) = 826 read(3, "\33[Z\0\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33["..., 1174) = 1174 read(3, "", 10) = 0 close(3) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TIOCGWINSZ, {ws_row=41, ws_col=105, ws_xpixel=0, ws_ypixel=0}) = 0 ioctl(2, TIOCGWINSZ, 0xbffff1a8) = -1 ENOTTY (Inappropriate ioctl for device) open("/usr/bin/.sysless", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/etc/sysless", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/home/lcampagn/.less", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/dev/tty", O_RDONLY|O_LARGEFILE) = 3 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 fsync(3) = -1 EINVAL (Invalid argument) ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0 rt_sigaction(SIGINT, {0x80587d0, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGTSTP, {0x8058810, [TSTP], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGWINCH, {0x8058850, [WINCH], SA_RESTART}, {SIG_DFL}, 8) = 0 stat64("tmp/testfile", {st_mode=S_IFREG|0644, st_size=15731, ...}) = 0 stat64("tmp/testfile", {st_mode=S_IFREG|0644, st_size=15731, ...}) = 0 open("tmp/testfile", O_RDONLY|O_LARGEFILE) = 4 _llseek(4, 1, [1], SEEK_SET) = 0 _llseek(4, 0, [0], SEEK_SET) = 0 read(4, "abcdefghijklmnopqrstuvwxyz012345"..., 64) = 64 _llseek(4, 1, [1], SEEK_SET) = 0 fstat64(4, {st_mode=S_IFREG|0644, st_size=15731, ...}) = 0 _llseek(4, 0, [0], SEEK_SET) = 0 write(1, "\33[?1049h\33[?1h\33=\33[41;1H\33[K", 25) = 25 read(4, "abcdefghijklmnopqrstuvwxyz012345"..., 8192) = 8192 write(1, "abcdefghijklmnopqrstuvwxyz012345"..., 1023) = 1023 write(1, "bcdefghijklmnopqrstuvwxyz0123456"..., 1023) = 1023 time([1107708601]) = 1107708601 write(1, "cdefghijklmnopqrstuvwxyz01234567"..., 906) = 906 read(3, "\33", 1) = 1 write(1, "\33[41;1H\33[K \33[KESC\10\10\10ESC", 23) = 23 read(3, "O", 1) = 1 write(1, "\33[KO\10O", 6) = 6 read(3, "B", 1) = 1 write(1, "\33[KB\10B\33[41;1H", 13) = 13 write(1, "\33[41;1H\33[Kabcdefghijklmnopqrstuv"..., 127) = 127 read(3, "\33", 1) = 1 write(1, "\33[41;1H\33[K \33[KESC\10\10\10ESC", 23) = 23 read(3, "O", 1) = 1 write(1, "\33[KO\10O", 6) = 6 read(3, "B", 1) = 1 write(1, "\33[KB\10B\33[41;1H", 13) = 13 time([1107708603]) = 1107708603 write(1, "\33[41;1H\33[K789abcdefghijklmnopqrs"..., 61) = 61 read(3, "\33", 1) = 1 write(1, "\33[41;1H\33[K \33[KESC\10\10\10ESC", 23) = 23 read(3, "O", 1) = 1 write(1, "\33[KO\10O", 6) = 6 read(3, "A", 1) = 1 write(1, "\33[KA\10A\33[41;1H", 13) = 13 write(1, "\33[H\33M789abcdefghijklmnopqrstuvwx"..., 56) = 56 read(3, "\33", 1) = 1 write(1, "\33[41;1H\33[K \33[KESC\10\10\10ESC", 23) = 23 read(3, "O", 1) = 1 write(1, "\33[KO\10O", 6) = 6 read(3, "A", 1) = 1 write(1, "\33[KA\10A\33[41;1H", 13) = 13 time([1107708604]) = 1107708604 write(1, "\33[H\33Mabcdefghijklmnopqrstuvwxyz0"..., 122) = 122 read(3, "q", 1) = 1 close(4) = 0 write(1, "\33[41;1H\33[K\33[?1l\33>\33[?1049l", 25) = 25 fsync(3) = -1 EINVAL (Invalid argument) ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0 ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 exit_group(0) = ?