gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.38k stars 293 forks source link

Session not properly sourced when starting from JSON #2099

Open ghost opened 2 years ago

ghost commented 2 years ago

I'm using Tilix with ZSH and Oh-My-ZSH. I'm trying to start a saved session with yarn running a command on startup. However, the $PATH variable does not contain NPM when the session is initialized and thus it cannot run yarn. To work around this, I have to manually source my .zshrc everytime I launch a new session. Example:

tilix -s session.json

session.json:

{
    "child": {
        "directory": "~/my-project",
        "overrideCommand": "/usr/bin/zsh -c '~/zsh-wrapper.sh \"yarn dev\"'",
        "profile": "2b7c4080-0ddd-46c5-8f23-563fd3ba789d",
        "readOnly": false,
        "synchronizedInput": false,
        "type": "Terminal",
        "uuid": "c6f6f82d-e5e9-4410-ba19-225a53778614",
    },
    "name": "${title}",
    "synchronizedInput": false,
    "type": "Session",
    "uuid": "ff347d1a-045f-46bc-bc22-71a0d3167232",
    "version": "1.0",
}

zsh-wrapper.sh:

#!/usr/bin/zsh

source ~/.zshrc

/usr/bin/zsh -c $1

Is there a better way to go about this?