Closed Nohac closed 8 years ago
hmm I can only reproduce this with zsh.
Does it also happen when you do not pass the -i flag to zsh (this fixes it for me). This looks to be not applicable here.
When using this command from terminal whithout -i: rofi -run-command "zsh -c '{cmd}'" -key-run F2 &
I can successfully launch programs, but -i is required to access aliases etc. it seems. With -i, the program starts to consume 100% until I kill it.
From sxhkd, both with and without -i does nothing, this is the sxhkd config:
alt + {_,shift} + space
rofi -run-command "zsh -c -i '{cmd}'" -show {run,window}
Are you sure your sxhkd configuration works as expected? It seems that {}
have a special meaning in there, so maybe the {cmd}
for rofi is conflicting?
I cannot reproduce from a terminal. Zsh 5.2 here.
I am unsure why -i is needed for aliases, given it is:
-i Force shell to be interactive.
According to manpage. Can try setting run-command Xresources? to see if it is conflicting syntax?
Zsh will read:
.zshenv
.zprofile
if -l
(login mode).zshrc
if -i
(interactive mode)Usually, you define aliases in .zshrc
because it is where they make sense, but in this case, you could actually use .zshenv
.
aah that explains, thx.
@sardemff7 You were right about the {cmd}
in sxhkd, it strips out {} from the command, so it only tries to run cmd
. I can't find a way to escape the curly brackets either, it must be a bug with sxhkd, or just something I've overlooked.
But that still doesn't explain why something like rofi -run-command "zsh -c -i 'vim'" -show run &
hangs and uses 100% cpu. htop shows zsh -c -i vim
as the command that hangs and uses all the cpu. The same command works from the terminal.
edit: I worked around the sxhkd issue by making a script, now everything seems to work. Thanks and I'm sorry for wasting your time, still weird about the background process issue though..
I worked around the sxhkd issue by making a script, now everything seems to work.
I just used back slashes and it seems to have escaped them. This works fine for me:
rofi -show drun -run-command 'gksudo \{cmd\}'
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Version
Version: 0.15.12
Configuration
gist
Launch Command
rofi -run-command "zsh -i -c '{cmd}'" -show run
Steps to reproduce
rofi -run-command "zsh -c -i '{cmd}'" -key-run F2 &
What behaviour you see
What behaviour you expect to see