|
From: | Marco Ippolito |
Subject: | Re: reset key bindings |
Date: | Tue, 31 Dec 2019 03:17:55 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 |
On 30/12/2019 16:10, Andrey Butirsky wrote:
On 30.12.2019 16:53, Greg Wooledge wrote:On Sun, Dec 29, 2019 at 10:58:44PM +0300, Andrey Butirsky wrote:I mean, if I screwed up the bindings somehow with `bind` command, I wouldlike to restore default bindings without restarting the shell. Just by a command, signal, etc..Honestly, restarting the shell would be a whole lot easier and faster. Just "exec bash" should be enough to undo one-off "bind" commands, as long as you didn't mess up the .inputrc or .bashrc files, or poke around the terminal with stty. (Following up with "reset" wouldn't be a bad call, though, just in case.)Understood.Didn't think about "exec bash", thanks. However, it's essentially a restarting. So you loose the environment, e.g.
If by "environment" you mean the exported environment variables.. `exec' "retains" them, they will be accessible:
export EXPORTED=foo; non_exported=bar; exec bash -c 'echo "$EXPORTED $non_exported"'
-> foo(perhaps run the above after having run an additional copy of bash if your terminal program, say gnome-terminal, closes the window when the shell exits, as the exec'd bash will exit immediately after echo'ing).
Or, what you mean by "environment"?
[Prev in Thread] | Current Thread | [Next in Thread] |