This is the readline library’s prompt when you’re inputting a numeric argument. By typing AltShift@ on your keyboard, you’re apparently entering Alt2 which maps to M-2
, which runs digit-argument
in readline by default, and starts entering a numeric argument. If you then press Alt3 (which AltShift# maps to in your case) you’ll see the prompt change to (arg: 23)
; you can continue with any Alt-digit combination.
These arguments are used for certain readline functions, for example yank-nth-arg
. To see this in action, run
echo Hello my friend
then press Alt2 followed by CtrlAltY; you’ll see the (arg: 2)
prompt appear, then disappear, and the second argument of the previous command (“my”) will be appended to your current command line.
See the linked documentation above for details. Bash uses readline to handle its input; other shells won’t show the same behaviour.
Some terminal emulators use some of these key combinations for their own purposes; for example in GNOME Terminal, Alt-digit switches to the nth tab. You’ll need to disable these combinations to use the readline functions.
In your case, the Codecademy web-based terminal emulator doesn’t seem to handle AltShift combinations very well. If you don’t need the numeric argument shortcuts, you can repurpose them by running
bind Meta-3:insert-comment
In theory you should be able to store this permanently by adding
Meta-3: insert-comment
to an ~/.inputrc
file, but I couldn’t get that to work on Codecademy.