You are not logged in.
Pages: 1
So I recently decided to switch from bash over to zsh, however have come up with a problem when using my old shortcuts from i3.
In my i3 config I have mod+w bound to:
exec --no-startup-id $BROWSER However this does not launch. When running the same command in a terminal I am given the output:
zsh: unknown exec flag -\M-[ This seems to only be an issue with a few programs namely; qutebrowser, firefox and blender. I have searched and googled but haven't found anywhere with the same issue.
Offline
What is BROWSER set to and where is it set? When you say you run the "same command" in a terminal, which command is that? Do you actually type `exec --no-startup-id $BOWSER` in a terminal? That will definitely not work. The i3 config entry is not a shell command; `exec` is a shell command and behaves entirely differently from i3's config entry (most notably the shell command `exec` doesn't accept a "--no-starup-id" flag ... it doesn't accept *any* flags).
I'd just change $BROWSER in your i3 config to the be the browser you actually want to use. Using enviornment variables in a WM config always seems to be a bad idea to me as it is generally done based on a misunderstanding about how enviornment variables actually work.
Last edited by Trilby (2018-04-04 12:15:27)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
$BROWSER is set in my .zshrc as qutebrowser.
This was fixed by replacing $BROWSER with qutebrowser. As a matter of instruction, why does this not work moving from a shell variable to the WM config?
Offline
How do you launch i3? Is zsh invoked as an interactive shell in one of the parent processes of whatever launches i3? If you use a display manager, it certainly isn't. If you log in to the tty and run xinit/startx then it might be if you log in to zsh in the tty.
Environment variables are not global, they are - as the name implies - inherited from a process's environment.
Also note that the above all assumes that i3 config is even parsed by a shell and/or otherwise can use environment variables. It's clearly not parsed directly by a shell. But if the content of the "exec" binding is passed verbatim to a shell, the shell would expand environement variables if (and only if) they were defined in an ancestor process's environment. Often WM bindings are not sent to a shell, but rather to an exec-family function in which case environment variables would not work at all.
Last edited by Trilby (2018-04-04 13:32:41)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks for this explanation, this clears it up for me.
Offline
Pages: 1