Changeset c35cc8b in mainline


Ignore:
Timestamp:
2026-01-29T15:05:24Z (3 weeks ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
26a9388
Parents:
81805e0
Message:

EW: Allow to override preferred terminal emulator via $TERMINAL

Allow to override the user's preferred terminal emulator via setting the
$TERMINAL environment variable (a quasi standard that hopefully does not
conflict with anything).

The variable might also contain preferred arguments. Thus the logic to
distinguish terminal emulators for the purpose of composing the final
command line has been slightly extended.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/ew.py

    r81805e0 rc35cc8b  
    7676
    7777def termemu_detect():
    78         emus = ['gnome-terminal', 'xfce4-terminal', 'xterm']
     78        emus = ['gnome-terminal', 'foot', 'xfce4-terminal', 'xterm']
     79
     80        if 'TERMINAL' in os.environ:
     81                emus.insert(0, os.environ['TERMINAL'])
     82
    7983        for termemu in emus:
    8084                try:
     
    8993def run_in_console(cmd, title):
    9094        temu = termemu_detect()
    91         if temu == 'gnome-terminal':
     95
     96        if os.path.basename(temu.split(' ')[0]) in ['gnome-terminal', 'foot']:
    9297                cmdline = temu + ' -- ' + cmd
    9398        else:
Note: See TracChangeset for help on using the changeset viewer.