Suggestion: add default for `--terminal` #113

Open
opened 5 months ago by markstos · 1 comments

It would reduce the amount of required configuration if there was a default value for --terminal:

A suggestion is:

  1. if $TERMINAL is set, use "$TERMINAL -e"
  2. if 'foot' is in the path, use "foot"
  3. print error message and exit with error code: "Attempted to load desktop file with Terminal=true but --terminal was passed and $TERMINAL is not set.

Many terminals support -e to pass a command including:

  • foot
  • konsole
  • gnome-terminal
  • alacritty
  • st
  • xterm
  • rxvt

Rofi uses rofi-sensible-terminal to solve the problem of finding a terminal to launch, but that seems like overkill and possibly error prone if you have multiple terminals installed. It's also no fun to maintain a constantly evolving list of terminals.


After switching from Alacritty to foot, I still found that sometimes I had instances of Alacritty getting launched and I couldn't figure out where they were coming from. Later, I found that I had --terminal "alacritty -e" embedded in a fuzzel-launching script.

If fuzzel had defaulted to $TERMINAL -e, I would have had one less place to update all my references to Alacritty.

It would reduce the amount of required configuration if there was a default value for `--terminal`: A suggestion is: 1. if $TERMINAL is set, use "$TERMINAL -e" 2. if 'foot' is in the path, use "foot" 3. print error message and exit with error code: "Attempted to load desktop file with `Terminal=true` but `--terminal` was passed and `$TERMINAL` is not set. Many terminals support `-e` to pass a command including: * foot * konsole * gnome-terminal * alacritty * st * xterm * rxvt Rofi uses [`rofi-sensible-terminal`](https://www.mankier.com/1/rofi-sensible-terminal) to solve the problem of finding a terminal to launch, but that seems like overkill and possibly error prone if you have multiple terminals installed. It's also no fun to maintain a constantly evolving list of terminals. ---- After switching from Alacritty to `foot`, I still found that sometimes I had instances of Alacritty getting launched and I couldn't figure out where they were coming from. Later, I found that I had `--terminal "alacritty -e"` embedded in a fuzzel-launching script. If `fuzzel` had defaulted to `$TERMINAL -e`, I would have had one less place to update all my references to Alacritty.
Owner

I like the idea of defaulting to something. I'd rather avoid depending on -e however, especially seeing how we've been preaching that applications shouldn't rely on terminals implementing -e over at foot...

Printing an error message and exiting with an error code is obviously a step-up from current behavior.

Another fairly common pattern is to have a builtin list of "supported" terminals, and use the first available one. I guess this is similar to rofi-sensible-terminal.

I would prefer to use $TERMINAL. I just don't like the idea of assming it understands -e. But perhaps that is the best option available.

I like the idea of defaulting to _something_. I'd rather avoid depending on `-e` however, especially seeing how we've been preaching that applications shouldn't rely on terminals implementing `-e` over at foot... Printing an error message and exiting with an error code is obviously a step-up from current behavior. Another fairly common pattern is to have a builtin list of "supported" terminals, and use the first available one. I guess this is similar to `rofi-sensible-terminal`. I would prefer to use `$TERMINAL`. I just don't like the idea of assming it understands `-e`. But perhaps that is the best option available.
dnkl added the
enhancement
label 4 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: dnkl/fuzzel#113
Loading…
There is no content yet.