I had a Konsole open and bumped my keyboard at-random with my left hand and I was surprised to see this on my screen:
BASH on Manjaro Linux arthur@optiplex-major Mon 2024-10-28, 11:20:31 AM
~/Belequenta/rhe/PWCC/293
%
::1 ff02::1 ff02::2 ip6-allnodes
ip6-allrouters ip6-localhost ip6-loopback localhost
optiplex-major
BASH on Manjaro Linux arthur@optiplex-major Mon 2024-10-28, 11:20:31 AM
~/Belequenta/rhe/PWCC/293
%sz
On experimenting, I found that the Meta key combined with any letter key not assigned to any keyboard shortcut will list hosts, then after the prompt returns, will pre-type “s” followed by the letter. (In the case quoted above, I hit Meta+z, so I got “sz” on the next line.)
So, what is going on there? Is this a bug or is this a feature? Is this documented anywhere?
No. Though, certain subdirectories of it are. That is not relevant here though.
No. The “command” is the invisible “Meta+z” which appears as the empty string after first “%”. The result of the “command” is to first list hosts, then return the prompt, then pre-type “sz” into the next line.
I think you’re confusing my 3-line prompt for “commands” and/or “responses”. No, it’s just a prompt. The issue isn’t related to the prompt or even the shell; it’s a Konsole-specific thing. I can ditch BASH entirely and open an SH shell instead and I get the same results if I type Meta+Letter for any letter not assigned to a keyboard shortcut. For example:
There, the “sh-5.2$” is the prompt, the “command” is an invisible Meta+z, and the “response” to the command is the listing of hosts, the return of the prompt, and the weird pre-typing of “sz” after the prompt.
Addendum: Oddly, it doesn’t work with ZSHELL. So apparently the choice of shell does have something to do with it.
Meta+Letter for any letter not already assigned to any keyboard shortcut, when typed into a BASH shell in a Konsole console in Manjaro-Plasma Linux.
The CWD is irrelevant. The phenomenon occurs in any CWD. You could be in “/home/bob/nachos” or “/opt/myapp/somefolder” or whatever.
Steps to replicate:
Use a Manjaro-Plasma system.
Open a “Konsole” console.
Run a BASH or SH shell.
Type Meta+Z or Meta+N
If that still doesn’t replicate it for you, then this [bug|feature] may not occur on every system. Though, there’s nothing especially non-standard about the system I’m using, so I’d be surprised if no one else can replicate this.
… hold my beer - I will respond honestly once my Manjaro Plasma VM has been booted up
I do not have a real Manjaro Plasma system.
I have switched from zsh to bashright from the start - bash is the system shell and also what is used in Konsole.
Edit: It is to do with the emacs key bindings used by bash; I think they are the default. For instance, if you switch to vi bindings, then Meta+z instead adds some control chars to the input line
In each case, the “prompt” is “sh-5.2$”; the “command” is the invisible Meta+z which I typed at each empty prompt line; and the “result” is the listing of hosts, followed by return of prompt, followed by the printing of “sz” after the next prompt.
The CWD or $PATH don’t figure into it at all. And I wouldn’t expect them to; this appears to be something in the machine-language code of the Konsole program itself. Here, I’ll prove that by emptying the PATH variable completely:
Interesting. It appears to be both a “feature” (in that it was deliberately put into Konsole 12 years ago for Emacs purposes), and a “bug” (in that outside of Emacs, the behavior is unexpected). Could be useful, though, as a quick way to get a list of hosts.