subshell prompt fix
Jindrich Novy
jnovy at redhat.com
Thu Nov 18 10:16:37 UTC 2004
Hi Leonard,
On Wed, 2004-11-17 at 03:45 +0100, Leonard den Ottolander wrote:
> How does the attached patch make the prompt look on BSD?
>
> Are there better ways to clear the line?
I'm sending two patches to fix the promptfix problem. The first one
(promptfix-simple) is pretty simple and it uses the fact that when '\r'
is sent to the shell, it not only sets the writing position to the first
column, but also clears the whole line (at least in my case). This needs
testing.
The second patch behaves more "rigorously" as it sets the position to
the beginning and assumes that '\r' won't clear the line. So it clears
only the part of the line, where the previous prompt was written. So it
remembers a size of previous prompt. This frees us from solving of COLS,
etc. problems and won't draw more characters than needed.
This version of the patches is #ifdef'd only for linux since it's tested
there. As far as I had a mail-clash with pchel there is different
workaround needed or different prompt drawing bug is present on other
environments such as FreeBSD. Unfortunately I have no access to such box
so I'll let to someone else to fix it for *BSD.
greetings,
Jindrich
--
Jindrich Novy <jnovy at redhat.com>, http://people.redhat.com/jnovy/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-CVS-20041117-promptfix-simple.patch
Type: text/x-patch
Size: 498 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20041118/3504bf61/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-CVS-20041117-promptfix.patch
Type: text/x-patch
Size: 1687 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20041118/3504bf61/attachment-0001.bin>
More information about the mc-devel
mailing list