feat(console): fix for conda in vterm

This commit is contained in:
Pavel Korytov 2021-07-20 21:43:08 +03:00
parent bd7d246fef
commit 7973aec28e
4 changed files with 37 additions and 19 deletions

View file

@ -17,6 +17,16 @@ alias cii="export INIT_CONDA=true && init_conda"
# Fish:2 ends here
# [[file:../../Console.org::*Fish][Fish:3]]
if ! test -n "$TMUX"; and ! test -n "$IS_EMACS";
colorscript random
end
# Fish:3 ends here
# [[file:../../Console.org::*Fish][Fish:4]]
set fish_greeting
# Fish:4 ends here
# [[file:../../Console.org::*Anaconda][Anaconda:1]]
function init_conda
eval /home/pavel/.guix-extra-profiles/dev/dev/bin/conda "shell.fish" "hook" $argv | source
end
@ -24,14 +34,10 @@ end
if test -n "$INIT_CONDA";
init_conda
end
# Fish:3 ends here
# Anaconda:1 ends here
# [[file:../../Console.org::*Fish][Fish:4]]
if ! test -n "$TMUX"; and ! test -n "$IS_EMACS";
colorscript random
# [[file:../../Console.org::*Anaconda][Anaconda:2]]
if test -n "$EMACS_CONDA_ENV";
conda activate $EMACS_CONDA_ENV
end
# Fish:4 ends here
# [[file:../../Console.org::*Fish][Fish:5]]
set fish_greeting
# Fish:5 ends here
# Anaconda:2 ends here

View file

@ -52,6 +52,8 @@
(setq conda-env-home-directory (expand-file-name "~/.conda/"))
(setq conda-env-subdirectory "envs")
(setenv "INIT_CONDA" "true")
(advice-add 'conda-env-activate :after
(lambda (&rest _) (setenv "EMACS_CONDA_ENV" conda-env-current-name)))
(unless (getenv "CONDA_DEFAULT_ENV")
(conda-env-activate "general")))

View file

@ -414,16 +414,6 @@ fish_vi_key_bindings
<<shell-aliases>>
#+end_src
Anaconda
#+begin_src fish
function init_conda
eval /home/pavel/.guix-extra-profiles/dev/dev/bin/conda "shell.fish" "hook" $argv | source
end
if test -n "$INIT_CONDA";
init_conda
end
#+end_src
| Guix dependency |
|-----------------|
@ -440,6 +430,24 @@ Suppress fish greeting
#+begin_src fish
set fish_greeting
#+end_src
** Anaconda
First, a function to initialize anaconda.
#+begin_src fish
function init_conda
eval /home/pavel/.guix-extra-profiles/dev/dev/bin/conda "shell.fish" "hook" $argv | source
end
if test -n "$INIT_CONDA";
init_conda
end
#+end_src
Then, check if launched from Emacs with environment activated.
#+begin_src fish
if test -n "$EMACS_CONDA_ENV";
conda activate $EMACS_CONDA_ENV
end
#+end_src
* Nushell
:PROPERTIES:
:header-args+: :tangle ./.config/nu/config.toml :comments link

View file

@ -341,6 +341,8 @@ References:
(setq conda-env-home-directory (expand-file-name "~/.conda/"))
(setq conda-env-subdirectory "envs")
(setenv "INIT_CONDA" "true")
(advice-add 'conda-env-activate :after
(lambda (&rest _) (setenv "EMACS_CONDA_ENV" conda-env-current-name)))
(unless (getenv "CONDA_DEFAULT_ENV")
(conda-env-activate "general")))
#+end_src