[Top][All Lists]

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

Re: regression with color prompt + utf8

From: Egmont Koblinger
Subject: Re: regression with color prompt + utf8
Date: Mon, 6 Feb 2006 12:53:11 +0100
User-agent: Mutt/1.5.8i

On Sun, Feb 05, 2006 at 03:49:38PM -0500, Chet Ramey wrote:

> If I'm reading this right, it's not a regression, per se.  It's always
> possible to fool the redisplay code by violating the assumptions it
> starts with, e.g., that the cursor always begins at column 0.
> [...]


Thanks for your answer.

As far as I know, it's not possible to ask the terminal where the cursor is,
neither is possible to send sequences such as "print a cr-lf if the cursor
is not in the first column". Am I right? So yes, this is a tough problem.

I do remember cases when the prompt did not appear in the first column, and
when entering a command (or pressing the up arrow or something like that) it
once jumped back to the 1st column. This did not bother me at all, since I
saw that the program's output didn't end with newline, and I could read the
last line as well. If I needed that to remain there for sure, I could press
an enter to get a new prompt.

What I do not understand is why color prompt and wide characters make a
difference. I guess this is because in this cases it is harder to keep track
where the cursor is and what the content is, and it is harder to update it
by solely relative movements, it's easier to redraw the full line.

On the other hand, I'd wish to see a solution to my problem, that is, to be
able to see the last (partial) line of a command's output, without ugly
tricks such as a prompt beginning with a newline.

Here's my proposal, I'm curious what you think about it:

- When a command finishes (or bash just starts up) it would simply display
the prompt just where the cursor is, that is, it wouldn't send any special
sequences to jump to the 1st column.

- When I press the very first key in a command line, the cursor is sent back
to the 1st column, the prompt is redisplayed there together with the first
pressed letter, as well as a clear to the end of the line to make sure no
part of the previous prompt is left there. However, as an exception, the
prompt wouldn't be redisplayed if the first key hit was an Enter, ^C or ^D
(or something similar that causes to leave that command line).

I think it cannot be so hard to implement it as the specification is failry
short, and the resulted behavior would be acceptable, too.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]