Skip to content

Instantly share code, notes, and snippets.

@ahlinc
Last active June 26, 2020 13:52
Show Gist options
  • Save ahlinc/943ed82ddf8417028b5f0005ec105989 to your computer and use it in GitHub Desktop.
Save ahlinc/943ed82ddf8417028b5f0005ec105989 to your computer and use it in GitHub Desktop.
KItty @ls minimal output

Start Kitty with folowing command from some other terminal to minimize side effects and reduce amount of items in Kitty's environment.

env -i DISPLAY=$DISPLAY TERM=$TERM DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS kitty bash --noprofile --norc

Inside of started Kitty:

env | sort                                 # To see a minimal current environment
cat /proc/$$/environ | tr \\0 \\n | sort   # To see that output of above command is a bit differ and it has SHLVL var

kitty @ launch bash --norc                 # To start new window and see that it has the same environment as the Kitty's main process.
                                           # So the environment isn't inherited from current window.
                                           
kitty @ launch --env FOO_BAR=22222 bash --norc  # To demonstrate that it's one explisit way to start new window
                                                # with explicitly patched environment

To run Kitty from source with minimal env:

env -i PATH=/usr/sbin:/usr/bin:/sbin:/bin DISPLAY=$DISPLAY TERM=$TERM DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS ./kitty/launcher/kitty bash --noprofile --norc

Without specified PATH as above ... ./kitty/launcher/kitty --help raises error because can't locate and call other commands, in this case it can't locate a less command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment