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

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

On Fri, Aug 13, 2004 at 10:17:04PM -0300, Joey Hess wrote:
> I've very confused by the way I see one thing if I run pstree straight, 
> and another thing if I redirect its output to a file and cat it. Also,
> which lines lack indentation seem to vary by what's in my process tree;
> for example right now, only one line of my pstree output is
> mis-indented, while there were many when I sent the bug.

the effective screen width (and wrapping) may differ.
> It's surely evil code, see bug #265553.

I'm trying to think of a tactful way to suggest it be rewritten (I don't
have time to do it myself).
> > > The strace shows that pstree is properly indenting the lines that do not
> > 
> > I'm not certain about "properly" unless I take the whole thing apart.
> > I'll look at the typescript (though it seemed mangled by the newsreader).
> By "properly" I meant only that each line is indented with a seemingly
> appropriate number of spaces, even though xterm does not always display the
> leading spaces.
> A typescript is a good idea. I've attached one taken with script. When
> I did this, and when I play this typescript back with cat, the only line
> that is mis-indented is the "xmms" one.

yes - I usually use script, since it rarely alters the output.  I've a few
utilities (unmap, slowcat) on my ncurses ftp area which are useful for
studying the typescript files.
> I'm using the stock debian xterm terminfo file BTW, though I suspect
> pstree does not even use it.

when I glanced over the code, I could see it called tgetent, to get the
"md" value (sgr0 in terminfo).  But as I noted, there are escape sequences
hardcoded in the output.

Thomas E. Dickey

Attachment: pgpUZcUp2sgue.pgp
Description: PGP signature

Reply to: