Re: subshell prompt fix



Hi,

On Wed, 2004-11-03 at 10:22, Jindrich Novy wrote:
> 1) run mc, chdir to /usr/share
> 2) C-o
> 3) C-o again and chdir to /usr/share/doc
> 4) C-o
> 
> in 2) you see: [jnovy obelix share]$
> in 4) you see: [jnovy obelix share]$ [jnovy obelix doc]$

How does the attached patch make the prompt look on BSD?

Are there better ways to clear the line?

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

--- mc-4.6.0-CVS20041117/src/main.c.promptfix	2004-10-22 07:47:25.000000000 +0200
+++ mc-4.6.0-CVS20041117/src/main.c	2004-11-03 10:02:05.923393096 +0100
@@ -434,7 +434,13 @@ void
 do_update_prompt (void)
 {
     if (update_prompt) {
+	/* MAXCOLS is set to 256 in slang/slvideo.c.
+	 * Sync with SLTT_MAX_SCREEN_COLS in slang/include/sllimits.h (now 512).
+	 * Why is LineBuffer MAXCOLS*2 in size?
+	 * MAXCOLS & SLTT_MAX_SCREEN_COLS are not available (--with-screen=ncurses)
+	 *  thus using 256 here.
+	 * Note that this limit only affects the number of cleared columns. lj */
-	printf ("%s", subshell_prompt);
+	printf ("\r%*s\r%s", COLS > 256 ? 256 : COLS, " ", subshell_prompt);
 	fflush (stdout);
 	update_prompt = 0;
     }


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