On my fairly vanilla Ubuntu 22.04 desktop installation I have six workspaces set up, and I like to have easy, explicit shortcuts for switching directly to each workspace and moving a window to each workspace. So I've set up Alt+1
to switch to workspace 1, Alt+2
to switch to workspace 2, and so on. These all work great. Then I've set up Shift+Alt+!
to move a window to workspace 1, Shift+Alt+@
to move a window to workspace 2, and so on. These all work great except for Shift+Alt+$
to move a window to workspace 4, which does nothing! It seems that some other function is preempting the use of Shift+Alt+$
specifically, but I have no idea what it is or how to find out.
One possible clue: I've noticed that when I press Shift+Alt+4
when the focus is on a Terminal window, the Terminal displays a message like Display all 141 possibilities? (y or n)
, and if I press y
, it appears to dump the names of a bunch of environment variables (e.g. BASH
, BASH_ALIASES
, BASH_ARGC
, and so on). I don't know what command this is -- and it doesn't seem to explain why the shortcut wouldn't work when a non-Terminal window has the focus -- but maybe this Terminal behavior is related to the problem somehow?
EDIT 2023-06-25: Here is a screenshot of the relevant shortcuts in Gnome settings showing that Shift+Alt+$ is bound to "Move window to workspace 4" as intended. As mentioned above, the similar shortcuts for workspaces 1-3 work fine (as well as the ones for workspaces 5-6 that I set up on the command line) but the one for workspace 4 does nothing.
EDIT 2023-07-02: First, just to confirm that the keybindings really are set up correctly, here is an excerpt from dconf dump /
:
move-to-workspace-1=['<Shift><Alt>exclam']
move-to-workspace-2=['<Shift><Alt>at']
move-to-workspace-3=['<Shift><Alt>numbersign']
move-to-workspace-4=['<Shift><Alt>dollar']
move-to-workspace-5=['<Shift><Alt>5']
move-to-workspace-6=['<Shift><Alt>6']
Again, all of these work except for the fourth one.
Second, a little research led me to discover that the "Display all X possibilities" message when I press Shift+Alt+4
in the terminal is coming from tab completion. There is an interesting result if I press Shift+Alt+4
between the double quotes in this command:
echo "" | cat -A
$
I get a single "$" as output. But, I only see the "$" if I use cat -A
not plain cat
, and I don't see it as I'm typing between the double quotes. So, taken together the evidence suggests that Terminal sees Shift+Alt+4
as something like <invisible "$"><tab><tab>
. This explains why when I respond y
to the "Display all possibilities" prompt, I basically get a list of all my environment variables, since those would be the tab completion results that start with "$".
It's a nice data point, but I still don't understand why this key combination is interpreted that way in the Terminal. If I type Shift+Alt+4
in a gedit window, for example, I see no output at all. So it doesn't generally produce a literal "$".