subshell prompt fix
Jindrich Novy
jnovy at redhat.com
Wed Nov 24 10:21:07 UTC 2004
Hello Pavel,
On Mon, 2004-11-22 at 21:42 +0200, Pavel Tsekov wrote:
> > On Wed, 2004-11-03 at 11:29, Pavel Shirshov (pchel) wrote:
> > > But. I see another:
> > > 1) run mc
> > > 2) C-o
> > > 3) C-o again
> > > 4) C-o
> > >
> > > 2) you see: genie#
> > > 4) you see:
> > > ^^^^^^^^^^^ I can't see promt.
> >
> > Weird, I'm unable to reproduce your case, which terminal do you use?
> > It's smoothly reproducible with gnome-terminal and xterm, I haven't
> > tried rxvt. Do you chdir in steps 2) and 4) ?
>
> I've just tried the above on a FreeBSD machine account provided by Pavel
> Shirshov. I run FC3 with GNOME desktop so I use gnome-terminal. When I
> ssh into the remote machine (FreeBSD) I have the TERM variable set to
> 'xterm' - in this case everything is fine. Now, I've tried changing the
> value of TERM to 'vt220'... surprise, surprise - the subshell prompt is
> missing just as Pavel says. So I've started a fresh gnome-terminal
> on my machine (FC3) and set TERM to 'vt220' - again no prompt. I've tried
> also with konsole with the same result.
>
> Soooo... what does this mean ? :)
Please see the top of the thread:
http://mail.gnome.org/archives/mc-devel/2004-November/msg00031.html
Since you're running FC3 with GNOME desktop and gnome-terminal with
TERM=xterm, you should smoothly reproduce the original bug I've been
trying to fix since I found this bug exactly with the same
configuration.
To fix the both cases of the bug we should probably get TERM variable
from the environment and do a specific fix related to its contents.
The attached patch does the following:
1st hunk:
the removed part caused to cut out the beginning of the prompt so we
get:
<truncated dir name>]$
instead of:
[jnovy at obelix <shortened dir name>]$
this part of code just prints the whole prompt without shortening to
subshell_prompt to let the prompt be displayed correctly via load_prompt
().
2nd hunk:
fix of the prompt drawing in subshell. It should display correct prompt
if it's size is less than COLS and redraw only the part of line where
was a previous prompt. If the prompt is larger that COLS, it'll draw the
prompt at a new line. Some additional work for this should be done since
we can use escape sequences to improve it a bit. And maybe we should cap
the value of COLS, etc.
3rd hunk:
Displays shrinked prompt in the panel (not subshell) mode with using
name_trunc(). This part is needed to let the prompt be displayed as
noted in the comment to 1st hunk.
Any comments are welcome.
greetings,
Jindrich
--
Jindrich Novy <jnovy at redhat.com>, http://people.redhat.com/jnovy/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-CVS-promptfix.patch
Type: text/x-patch
Size: 2474 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20041124/48f31aff/attachment.bin>
More information about the mc-devel
mailing list