Ctrl+a+d exiting terminal

terminal

I don't know what I have changed, but if I am on a terminal and I press Ctrl+a+d (that is, the three keys simultaneously) the terminal is killed. This is on gnome-terminal on Ubuntu and using zsh as the default login shell.

I checked the keyboard shortcuts on gnome-terminal (on the GUI, under Edit->Keyboard Shortcuts) and searched for bindkey statements that may trigger this undesired shortcut in my home directory but found nothing.

I am pretty sure that this is new behavior (last couple of days) since I frequently type Ctrl-a to go to the beginning of a line on my terminal and then Ctr-d to delete characters, and if I do this at the moment, it triggers this undesired keyboard shortcut.

I recently installed some system updates, but I'd be surprised if these updates changed shortcuts. At the moment I have no clue why this is happening, so any help will be greatly appreciated.

Note: This only happens on terminals. If I am on some other app, Ctrl+a+d does not trigger any exit commands.

Best Answer

If you type Ctrl+D on an empty line you're signaling End-Of-File (EOF) for that particular shell instance. When the shell gets an EOF it will terminate and the terminal window will close. If you push those keys simultaneously it will in practice be the same as either Ctrl+A and then Ctrl+D or the other way around.

Ctrl-D is a convenient way to exit a shell/terminal window, logout from a remote login session or signal the end of input if you're running a program that accepts input when you run it.

Related Question