5

Whenever you are in vi command mode on the shell and hit a number, like 8, "(arg: 8)" shows at the start of the line. Anyone know how to make it not do that? The moving the line I'm typing is distracting.

Instead of:

(arg: 8) somecmd --itslong --reallylong

This:

somecmd --itslong --reallylong

2 Answers2

1

When you're in command mode in vi (the the actual editor or the Bash mode), pressing digits inputs an argument (hence "arg") that is usually used to set the number of repetitions to perform the following command. To avoid that, you should be in input mode (by pressing i for example) before pressing digits.

Demonstration:

If you're not in vi mode, you can enter it using:

set -o vi

(You can exit vi mode by entering emacs mode: set -o emacs)

Now, in vi input mode type a command like this:

echo abcdefghijk4

You'll notice that you get a digit "4" at the end just as shown above.

Now press Esc. The cursor will move one character to the left and you're now in command mode.

Press a digit, let's say "3". Now you'll see this:

(arg: 3) echo abcdefghijk4

Now press capital X. You should see:

echo abcdefgh4

Three characters ("ijk") have been deleted because you told Readline (Bash's command-line input editor) to "rubout" 3 characters.

Now press i and any digit. The digit was inserted in the command line at the point where the cursor was.

  • 1
    Right, I know all this. I want it not to say (arg: 3) and just rubout the characters. The issue I have with the way it works is in a long command the command gets shifted to the right causing my eyes to refocus on what I'm typing. I know in that case it's going to repeat 3 because I typed 3. – Justin Thomas Apr 16 '14 at 03:38
  • 1
    @justinthomas: There was no indication in your question that you knew what I posted in my answer. There's not any way to do what you want. – Dennis Williamson Apr 16 '14 at 04:07
  • 1
    Really? I said how do I make it not do that. Though that should have been show the args. – Justin Thomas Apr 16 '14 at 06:10
1

The offending code is in: lib/readline/misc.c

Removing lines 109 and 241 will remove the message.

slm
  • 369,824