Question: "command key + letter" outputs hostnames #855
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am wondering what command or shortcut is being triggered when I press the command key and any letter (numbers and punctuation don't appear to do anything). Somehow, it is triggering crt to output a list of hostnames from the /etc/hostnames but without the IP addresses. It actually seems like a useful feature, but I have no idea what it is or if I can recreate it in a normal terminal session. I discovered this because of muscle memory when trying to run command+k to clear the screen, which is the standard shortcut in macOS' terminal to do so. There's already an issue for this: https://github.com/Swordfish90/cool-retro-term/issues/839
If it matters, I'm on version 1.1.1 of cool-retro-term because of still being on macOS 10.12.
Screenshot:

This is your shell’s hostname completion feature. In
bash
, it’s bound toM-@
andC-x @
by default. (M-
stands forMeta
which in terminal emulator context mostly means prefixing a key withESC
, sometimes also available by holdingAlt
; andC-
stands forCtrl
.)Command
(properly portably namedGUI
orSuper
) is a prefix that some terminal emulators do not relay at all, and some relaying differently. CRT seems to translate it into Emacs-inspiredC-x @ s
sequence followed by the base key, which is whySuper+k
gives you a list of hostnames (C-x @
) followed by addings
(leftover from theC-x @ s
sequence) andk
(base key) to your command line.Read the manual for your shell (which might not be
bash
) on how to unbind hostname completion or rebind it to a different key sequence.Also, the conventional key to clear the terminal is
Ctrl+L
at shell prompt.Thanks @yurikhan, your response was hugely informative and exactly what I was looking for!