In bash shell the keyboard shortcut to reach the beginning of the current line is CTRL key + A . This is the behaviour on an Oracle Linux 8.2 server running on kernel 4.18.0-193. Oracle Linux is pretty much a clone of RHEL/Fedora.
Fedora’s gnome terminal is bash as well, if I am not mistaken.
But, when I use the keyboard shortcut CTRL key + A in Fedora 32’s gnome terminal, it selects all the text in the terminal instead(as if it is a text editor) !!! I believe this wasn’t the case at least till Fedora 30. Only 2 weeks back, I upgraded from Fedora 30 to 32.
So, has anything changed with gnome terminal or bash recently ?
BTW CTRL+E shortcut remains the same (takes u to the end of the line)
Oh ok. Thanks rhiyddun. I added “set -o emacs” in ~/.bash_profile. Didn’t help.
$ cat ~/.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
# User specific environment and startup programs
set -o emacs
$ source ~/.bash_profile
Tried adding the same in ~/.bashrc file too. But, CTRL+A still selects all the text instead of taking me to the beginning of the line.
Tried setting “set -o emacs” directly in the shell . Didn’t work either. Not sure why?
BTW I never had to add this “set -o emacs” before. In the Oracle Linux 8.2, this “set -o emacs” thing is not set in .bash_profile or .bashrc files. But CTRL+A still takes you to the beginning of the line.
So, “set -o emacs” command makes the bash shell behave like an emacs editor. Right? I wanted to look up what -o does in set command. But, man page for set command seemed bit complicated for me !
In order to isolate the issue, try to install another terminal (i.e. terminator or tilix).
In that way you can try to figure out if the problem is related to the bash environment, or to some shortcut in gnome-terminal or GNOME itself that takes the precedence over the normal behavior.
In order to switch interactively between emacs and vi editing modes, use the ‘set -o emacs’ and ‘set -o vi’ commands (see The Set Builtin). The Readline default is emacs mode.
The complete doc is worth going over:
As you’ll also read there, command line editing is provided by the readline library. So, you should also check if you’ve changed any settings related to that.
(I use the vim mode, so none of these work here.)
To add to @alciregi’s suggestion, another way to test is to create a new user which will use the default configuration and see if the issue persists there. If it does not, then it is not a general OS level issue, but a user configuration level issue.
Notes on this: while it may be a “clone” of Fedora, the versions of software are completely different. This even applies to RHEL and Fedora: Fedora always has newer versions of software than RHEL, so not everything that works in Fedora will work that same on RHEL or other derivatives (CentOS/Scientific Linux). The actual versions of the software need to be taken into account.
Next, gnome-terminal is simply a terminal emulator. It will run whatever shell implementation you want to use. By default, in Fedora, the shell is bash, but lots of people use csh/zsh/fish and so on.
alexpl is right. My bad.
Two weeks back, I changed the keyboard shortcut for “Select all” in gnome-terminal’s preferences to CTLR+A without thinking of this repercussion.
The reason I did this was I could not find a ‘Select all’ option in drop down menus or right click in gnome-terminal.
Incidentally, this was to capture the entire terminal output of version upgrade from Fedora 30 to 32 which I did through command line
Now, I have changed “Select all”'s keyboard shortcut to CTRL+Q. Hope this won’t have any repercussion Is there a commonly used keyboard shortcut for this in gnome-terminal in the Linux community ?
Usually, how do you guys select all the text in gnome-terminal ? I don’t see any straightforward option for this.