Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: "command key + letter" outputs hostnames #855

Closed
Ferrisx4 opened this issue Aug 24, 2024 · 2 comments
Closed

Question: "command key + letter" outputs hostnames #855

Ferrisx4 opened this issue Aug 24, 2024 · 2 comments

Comments

@Ferrisx4
Copy link

Ferrisx4 commented Aug 24, 2024

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: #839

If it matters, I'm on version 1.1.1 of cool-retro-term because of still being on macOS 10.12.

Screenshot:
Screen Shot 2024-08-23 at 10 25 11 PM

@yurikhan
Copy link
Contributor

This is your shell’s hostname completion feature. In bash, it’s bound to M-@ and C-x @ by default. (M- stands for Meta which in terminal emulator context mostly means prefixing a key with ESC, sometimes also available by holding Alt; and C- stands for Ctrl.)

Command (properly portably named GUI or Super) is a prefix that some terminal emulators do not relay at all, and some relaying differently. CRT seems to translate it into Emacs-inspired C-x @ s sequence followed by the base key, which is why Super+k gives you a list of hostnames (C-x @) followed by adding s (leftover from the C-x @ s sequence) and k (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.

@Ferrisx4
Copy link
Author

Thanks @yurikhan, your response was hugely informative and exactly what I was looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants