raboof/notion

Allow invoking commands in a termite terminal

raboof opened this issue · 5 comments

When you do "Mod4+j :alsamixer", we will start $XTERM alsamixer.

This works fine for most terminal emulators, but the 'termite' emulator needs to be invoked like termite -e alsamixer. Perhaps we should introduce an option for that flag?

Two thoughts, xterm seemingly accepts -e too, and I'm not sure whether all terminal emulators have in common that everything following -e is the command (as separated by the shell tokenizer) or whether some expect a command in a single string and spawn that in /bin/sh -c...

r00t- commented

ion-runinxterm already passes -e, are you sure that is the issue?

exec $XTERMCMD -T "$title" -e $0 $wait -phase2 "$@"

(that script is used as documented at

-- This function asks for a command to execute with \file{/bin/sh}.

and implemented at
-- Run \var{cmd} with the environment variable DISPLAY set to point to the

)

(xterm supports specifying a single command (with no arguments) as the "shell" to run, but in a quick check i didn't find any other terminal emulator that does that.)

ion-runinxterm already passes -e, are you sure that is the issue?

Ah, interesting, this is a bit more intricate then I thought. Thanks for the pointers!

I since switched from termite to kitty though, which also works, so I don't personally need this feature anymore.

r00t- commented

i think the error is in that termite expects only a single string as the argument to -e,
while -e on any other terminal emulator means to use the following remainder of argv as the command and arguments.

https://github.com/thestinger/termite/blob/master/termite.cc#L1651

for a quick fix, you can probably edit ion-runinxterm to wrap the arguments following -e into double-quotes.
otherwise i suggest to file a bug with termite.

Termite has been superseded by alacritty. Please open a new issue if the problem persists in other terminal emulators.