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

Closed
opened 2024-08-24 04:27:51 +02:00 by Ferrisx4 · 2 comments
Ferrisx4 commented 2024-08-24 04:27:51 +02:00 (Migrated from github.com)

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:
Screen Shot 2024-08-23 at 10 25 11 PM

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: <img width="1552" alt="Screen Shot 2024-08-23 at 10 25 11 PM" src="https://github.com/user-attachments/assets/e0d30300-050b-4c94-b9ce-81d709de47ed">
yurikhan commented 2024-08-24 08:46:03 +02:00 (Migrated from github.com)

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.

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 commented 2024-08-24 17:26:41 +02:00 (Migrated from github.com)

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

Thanks @yurikhan, your response was hugely informative and exactly what I was looking for!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seeseemelk/cool-retro-term#855
No description provided.