BASH builtin 'undo' action not working

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

BASH builtin 'undo' action not working

#1 Post by sc0ttman »

Ctrl-_ or Ctrl-x or Ctrl-u should allow me to do an 'undo' action in the terminal... but the last two are set to other things by default, and Ctrl+_ (Ctrl and underscore) doesn't work...

Here's a list of keystrokes/commands you can do: http://ss64.com/bash/syntax-keyboard.html

How can I enable the built in 'undo' action of bash?

What do I have to put into my /etc/inputrc file?

From the BASH manual:
undo (C-_ or C-x C-u)

Incremental undo, separately remembered for each line.
Edit, I've remapped it to Alt-Left:

Code: Select all

#re-map 'undo' to Alt-Left
"\e[1;3D": undo
But ideally, I'd like to try using Shift-Left ... any ideas ???
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#2 Post by npierce »

What version of bash do you have?

Code: Select all

help | head -1
In all of the Puppies that I have used C-_ (Ctrl+underscore) has always worked fine for undo. In fact, C-- (Ctrl+minus) usually works as well.

Perhaps it is being grabbed by something else. Might you have added a binding for jwm, ROX-Filer, or xbindkeys?
sc0ttman wrote:Ctrl-_ or Ctrl-x or Ctrl-u should allow me to do an 'undo' action in the terminal...
Actually, it's not Ctrl-x or Ctrl-u that does undo; it's Ctrl-x followed by Ctrl-u that you want. Ctrl-x is kind of an into key for a number of commands, depending on what is pressed after it.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#3 Post by sc0ttman »

npierce wrote:What version of bash do you have?

Code: Select all

help | head -1
In all of the Puppies that I have used C-_ (Ctrl+underscore) has always worked fine for undo. In fact, C-- (Ctrl+minus) usually works as well.

Perhaps it is being grabbed by something else. Might you have added a binding for jwm, ROX-Filer, or xbindkeys?
sc0ttman wrote:Ctrl-_ or Ctrl-x or Ctrl-u should allow me to do an 'undo' action in the terminal...
Actually, it's not Ctrl-x or Ctrl-u that does undo; it's Ctrl-x followed by Ctrl-u that you want. Ctrl-x is kind of an into key for a number of commands, depending on what is pressed after it.
GNU bash, version 4.2.0(1)-release (i386-pc-linux-gnu)

Mrxvt is grabbing the defaults.. it compiled in, still grabs it when you remove the relevant settings from the config file..

.. And yeah, I just checked, Ctrl-x,then Ctrl-u does the job, but i already mapped it to Alt-Left, which works lovely .. Shift left would be better.. (Or at least to know how to add Shift+blah and to inputrc would be nice... ???) ...

What are the hotkey definitions for Alt, Shift and Ctrl respectively in inputrc?

BTW, if anyone cares, i dont know what Puppy uses as default, but I had to change the value of $EDITOR in bashrc to make 'Ctrl-x, then Ctrl-e' load up an editor in the terminal...

I set mine to EDITOR="mp -txt" .. Now I can use a fully featured text editor, in-place in the terminal, to execute multi line commands .. nice.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

Post Reply