[Top][All Lists]

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

Bug with print-completions-horizontally

From: David Kaasen
Subject: Bug with print-completions-horizontally
Date: Wed, 26 Sep 2012 13:06:26 +0200 (CEST)
User-agent: Alpine 1.10 (DEB 962 2008-03-14)

(I posted this to gnu.bash.bug on 2012-08-30 with message id address@hidden, but it never appeared)


I have got tired of an old bug with print-completions-horizontally. When that variable is set, and one of the matches is longer than half of the terminal width, all the matches are printed on a single line separated by a lot of spaces. Also, in that case, the internal pager doesn't work.

I have seen this bug consistently on all platforms and terminals since bash version 2.something.

The following patch to bash 4.2 seems to fix this:

diff -aNru bash-4.2_a/lib/readline/complete.c bash-4.2_b/lib/readline/complete.c
--- bash-4.2_a/lib/readline/complete.c  2011-01-16 21:32:57.000000000 +0100
+++ bash-4.2_b/lib/readline/complete.c  2012-08-29 16:21:19.000000000 +0200
@@ -1463,7 +1463,7 @@
          /* Have we reached the end of this line? */
          if (matches[i+1])
-             if (i && (limit > 1) && (i % limit) == 0)
+             if (i % limit == 0)
                  rl_crlf ();

With best regards from
David Kaasen.

reply via email to

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