raboof / notion

Tiling tabbed window manager
https://notionwm.net/
GNU Lesser General Public License v2.1
268 stars 63 forks source link

Allow invoking commands in a termite terminal #299

Closed raboof closed 1 year ago

raboof commented 3 years ago

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?

wilhelmy commented 3 years ago

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 3 years ago

ion-runinxterm already passes -e, are you sure that is the issue? https://github.com/raboof/notion/blob/72d4b2504588baf17c6934476232afab924f113a/utils/ion-runinxterm#L43

(that script is used as documented at https://github.com/raboof/notion/blob/72d4b2504588baf17c6934476232afab924f113a/mod_query/mod_query.lua#L821 and implemented at https://github.com/raboof/notion/blob/72d4b2504588baf17c6934476232afab924f113a/ioncore/ioncore_wd.lua#L105 )

(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.)

raboof commented 3 years ago

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 3 years ago

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.

wilhelmy commented 1 year ago

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