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.74k stars 241 forks source link

config option to set env variables #724

Closed mschwartz closed 3 years ago

mschwartz commented 4 years ago

I may have missed it, but I could not find a way in termite.conf to SET env variables. Seems like a very useful feature to me.

For example, set env variable TERMINAL='termite'

then in sh scripts, you can do special logic based upon $TERMINAL

Thanks for the program, it's awesome.

Narrat commented 4 years ago

Maybe I miss something. But why should it be possible with the terminal emulator config? Those are normally set in one of the possible config files for the shell you use with said terminal emulator.

mschwartz commented 4 years ago

In my .zshrc or .bashrc, I want to be able to do specific logic depending on if running in termite.

So the env variable has to be set before the shell is run...

mschwartz commented 4 years ago

Kitty terminal program, can be set in kitty.conf:

https://sw.kovidgoyal.net/kitty/conf.html

env Specify environment variables to set in all child processes. Note that environment variables are expanded recursively, so if you use:

env MYVAR1=a env MYVAR2=${MYVAR1}/${HOME}/b The value of MYVAR2 will be a//b.

mschwartz commented 4 years ago

Also, env is more general purpose than setting some well-known env var automagically within termite.

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.