[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#265552: pstree indentation doesn't line up in xterm

Package: xterm
Version: 4.3.0.dfsg.1-6
Severity: normal

The pstree command outputs a process tree, and on a capable terminal
such as xterm it will use some kind of escape sequences to display line
drawing characters(?). It seems that this sometimes confuses xterm
leading to display glitches. Let me try to paste in what I'm seeing:

     x     mqxdmqqq.xsessionqwqionqwqfirefo+
     x                       x     tqxchatqqqxchat+
     x                       x     tqxmmsqqqxmms
x                       x     tqxtermqqqzsh
x                       x     tqxtermqqqzsh
x                       x     tq3*[xtermqqqzs+
     x                       x     tqxtermqqqzsh
x                       x     tqxtermqqqzsh
x                       x     tqxtermqqqzsh
x                       x     mqxtermqqqzsh
x                       tqprocmeter3
     x                       tqssh-agent

Well, it lost the line drawing characters, but you can see some of the x's
don't line up. Here's how it is intended to look, from pstree ran with

     |     `-xdm---.xsession-+-ion-+-firefox-bin---firefox-bin---3*[firefox-bi+
     |                       |     |-xchat---xchat---xchat
     |                       |     |-xmms---xmms---2*[xmms]
     |                       |     |-xterm---zsh---tail---tail
     |                       |     |-xterm---zsh---w3m
     |                       |     |-xterm---zsh---mutt---editmail---vim
     |                       |     |-4*[xterm---zsh]
     |                       |     |-xterm---zsh---ssh
     |                       |     `-xterm---zsh---pstree
     |                       |-procmeter3

So the indentation is broken with the line drawing characters. At first I
assumed this was a pstree bug, but then I straced it:

write(1, "     \33(0\17tq\33(Bxdm\33(0\17qwq\33(BXFree"..., 41     tqxdmqwqXFree86-debug
) = 41
write(1, "     \33(0\17x\33(B     \33(0\17mq\33(Bxdm\33("..., 80     x     mqxdmqqq.xsessionqwqionqwqfirefo+
) = 80
write(1, "     \33(0\17x\33(B                   "..., 80     x                       x     tqxchatqqqxchat+
) = 80
write(1, "     \33(0\17x\33(B                   "..., 80     x                       x     tqxmmsqqqxmms
write(1, "     \33(0\17x\33(B                   "..., 80     x                       x     tqxtermqqqzsh
write(1, "     \33(0\17x\33(B                   "..., 80     x                       x     tqxtermqqqzsh
write(1, "     \33(0\17x\33(B                   "..., 80     x                       x     tqxtermqqqzsh
write(1, "     \33(0\17x\33(B                   "..., 80     x                       x     tq3*[xtermqqqzs+
) = 80

The strace shows that pstree is properly indenting the lines that do not
diplay indented when it's not straced. Also, notice that after each write()
output by strace, we see the actual result of the write, and in each case
xterm managed this time to display the leading indentation properly.

I sshed around to a few other systems, and pstree on those has the
occasional missing indentation too. These systems were running various
versions of pstree. I also tried running it in gnome-terminal, and in
uxterm, and in both cases it displayed ok. I cleared all X resource
setting (xrdb </dev/null; xterm) and can still reproduce the problem; I
also tried running pstree in an xterm (4.3.0.dfsg.1-4) on another computer,
and still saw the problem.

I've managed to capture some pstree output to a file that seems to
reproduce the problem when I cat it in an xterm, even an xterm on
another machine. I've attached that file. When this file is catted,
the result is not identical to the pstree indentation problem I
described above; only one or two lines are displated without
indentation. I hope it's enough to help reproduce the bug.

see shy jo

Attachment: pstree-output
Description: Binary data

Attachment: signature.asc
Description: Digital signature

Reply to: