kakounedotcom / connect.kak

Connect a program to Kakoune clients
https://kakoune.org
The Unlicense
88 stars 18 forks source link

env overrides don't seem to work w/ fish #18

Closed basbebe closed 4 years ago

basbebe commented 4 years ago

I'm using fish shell and kitty terminal.

When I open a new terminal with :connect-terminal, the environment in the new shell isn't completely sset it seems. $EDITOR and $VISUAL are still the same for me…

alexherbo2 commented 4 years ago

Maybe because you set these values in Fish.

Fish reads its config files and your user config every time it launches the shell, even when running a script, which might have side effects.

basbebe commented 4 years ago

Yes, this is probably the Problem. Do zou know of a way around this? I thought bash / zsh would also read their variables on launch by default?

alexherbo2 commented 4 years ago

You can set the connect_environment option to set your SHELL to your favorite shell with additional parameters, or directly from the command-line with :connect-terminal fish --option value.

https://github.com/alexherbo2/connect.kak#configuration

basbebe commented 3 years ago

for the record: adding this to my config.fish did work for me:

    # connect.kak
    if test -n "$IN_KAKOUNE_CONNECT"
        set -x EDITOR :edit
        set -x VISUAL :edit
    end
basbebe commented 3 years ago

* because after all I wasn't able to get this to work (and I don't know why):

set-option global connect_environment %{
        export SHELL="/usr/local/bin/fish --init-command=\"set -x EDITOR :edit; set -x VISUAL :edit\""
    }
alexherbo2 commented 3 years ago

The favorite way I think is to source an additional file.

basbebe commented 3 years ago

might try this as well. I was just really irritated that I wasn't able to get it to work by passing the arguments to the env variable.