tmux-plugins / tmux-resurrect

Persists tmux environment across system restarts.
MIT License
11.42k stars 424 forks source link

Difficulty Restoring Julia REPL Process #366

Closed TheCedarPrince closed 4 years ago

TheCedarPrince commented 4 years ago

Hi all - thank you for a wonderful project! It works amazingly well for my workflow with tmux, nvim, programming, writing, and research. :smiley:

One issue that I am running into is the inability to resurrect a Julia REPL process. I examined issue #224 as it was similar to my issue but that solution did not work for me. Furthermore, I consulted the documents on restoring a program but no luck there too.

My ~/.tmux/resurrect/last file looks like this:

pane    0   1   :Javis  0   :   0   :/home/src/Projects/javis   1   nvim    :nvim test.jl
pane    0   1   :Javis  0   :   1   :/home/src/Projects/javis   0   julia   :julia
pane    0   1   :Javis  0   :   2   :/home/src/Projects/javis   0   zsh :
pane    0   2   :NeuriViz   1   :*  0   :/home/src/Projects/neuriviz    0   nvim    :nvim
pane    0   2   :NeuriViz   1   :*  1   :/home/src/Projects/neuriviz    0   julia   :julia
pane    0   2   :NeuriViz   1   :*  2   :/home/src/Projects/neuriviz    1   zsh :
pane    0   3   :Zettelkasten   0   :-  0   :/home/src/Knowledgebase/Zettelkasten   1   nvim    :nvim
pane    1   1   :zsh    1   :*  0   :/home/cedarprince  1   zsh :
window  0   1   0   :   1d0c,192x53,0,0{96x53,0,0,1,95x53,97,0[95x26,97,0,5,95x26,97,27,6]}
window  0   2   1   :*  43c6,192x26,0,0{93x26,0,0,7,98x26,94,0[98x11,94,0,8,98x14,94,12,9]}
window  0   3   0   :-  610f,192x26,0,0,10
window  1   1   1   :*  5e17,192x53,0,0,37
state   0   1

and I tried the line set -g @resurrect-process '~julia' in my tmux.conf file but no luck. Any thoughts as to why this is not resurrecting the Julia REPL processes? Thanks for any help!

(CC @moelf)

bruno- commented 4 years ago

The variable name is @resurrect-processes (plural). Is that the error? I think set -g @resurrect-processes 'julia' should work.

TheCedarPrince commented 4 years ago

@moelf, does this work for you now?

Moelf commented 4 years ago

works for python but not julia it seems

TheCedarPrince commented 4 years ago

I think you may need to add it possibly like this if I read the documentation correctly: set -g @resurrect-processes '~julia'

Moelf commented 4 years ago

still doesn't work for some reason

last:

pane    0   1   :julia  1   :*  0   :/home/akako    1   julia   :julia
window  0   1   1   :*  cafd,120x29,0,0,0
state   0

config:

...
set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes '~julia'
set -g @resurrect-processes '~python'
...
TheCedarPrince commented 4 years ago

How curious! Any thoughts @bruno- ?

bruno- commented 4 years ago

set -g @resurrect-processes '~python' line is overriding a previous line with julia.

Moelf commented 4 years ago

@bruno- ah, I see they don't stack, instead I should put all the additional programs into a single line as described here: https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_programs.md

thx!

TheCedarPrince commented 4 years ago

@Moelf - just so it is clear, did the following work for you:

set -g @resurrect-processes 'python julia'

or did you have to do something different? Thanks!

Moelf commented 4 years ago

each with an additional ~ for scripts running

TheCedarPrince commented 4 years ago

Wonderful! So the final command would look something like this then:

set -g @resurrect-processes 'python julia' if no scripts are running set -g @resurrect-processes 'python ~julia myfile.jl' if there is a script running

Is that how it ended up working for you @Moelf ?

Moelf commented 4 years ago

no there no myfile.jl, I just put the ~ in case I'm running some scripts

TheCedarPrince commented 4 years ago

Perfect! Thanks for the help @bruno- and glad we could figure out what was going on @Moelf . I'll close this issue now. :smile: