thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.73k stars 240 forks source link

Allow executing a command with spaces #679

Closed varac closed 3 years ago

varac commented 5 years ago

Most terminals allow passing a command with spaces like this:

 ~ $ urxvt -e ssh example.org   
…
 ~ $ uxterm -e ssh example.org 
…

But termite failes on that:

 ~ $ termite -e ssh example.org

(termite:720): GLib-WARNING **: 15:43:39.674: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). See the documentation of g_child_watch_source_new() for possible causes.

Please fix this to have a coherent behaviour that can be used by applications that allow users to make use of different terminals like https://albertlauncher.github.io

twouters commented 5 years ago

I don't think it's related to the space, I get the same warning with termite -e vim

varac commented 5 years ago

I don't think it's related to the space, I get the same warning with termite -e vim

The problem is not the warning. Please ignore it in this issue.

The problem is that termite -e vim opens vim, but:

$ termite -e vim -v
termite v15

doesn't display the version of vim but rather the version of termite, which is not the way it should work and other terminals handle multiple commands separated with spaces after -e fine.

varac commented 5 years ago

https://www.debian.org/doc/debian-policy/ch-customized-programs.html#packages-providing-a-terminal-emulator:

To be an x-terminal-emulator, a program must:

…
Support the command-line option -e command, which creates a new terminal window [6] and runs the specified command. <command> may be multiple arguments, which form the argument list to the executed program. In other words, the behavior is as though the arguments were passed directly to execvp, bypassing the shell. (xterm’s behavior of falling back on using the shell if -e had a single argument and exec failed is permissible but not required.)
…
BarbUk commented 5 years ago

I don't know if it helps, but using quote or double quote fix this issue.

Instead of :

termite -e ssh example.org

use

termite -e 'ssh example.org'

I use --exec like that in scripts without issue, cf: https://github.com/BarbUk/dotfiles/blob/master/bin/dmenu_ssh

varac commented 5 years ago

@BarbUk Thx for the hint. However, my usecase is to make termite work with albert, and there's very little to configure how albert executes commands using a terminal. Currently it's impossible to use termite together with albert, because termite is not standard compliant at least to the above mentioned debian terminal guidelines.

thestinger commented 3 years ago

Termite is obsolete. Please use Alacritty instead. See https://github.com/thestinger/termite#termite-is-obsoleted-by-alacritty for more details.