Comments (11)
Hi, thanks for reporting the issue. This is a bug and I don't know how to handle it for now.
To clarify:
- this is the command you run:
grunt development
- when saving tmux environment, this is saved:
grunt ARCHFLAGS=-arch i386 -arch x86_64 Apple_PubSub_Socket_Render=/tmp/launch-Ou97Qf/Render
Weird env variables ARCHFLAGS
and Apple_PubSub...
are fine, we could remove them.
Unfortunately I don't see the word development
in there, so that information is lost and can't be restored.
Thinking about other solutions to handle this, we could have a user option like this:
set -g @some-tmux-option "grunt->grunt development"
The above states: to restore grunt
, the command to restore it is grunt development
.
Would having that feature help?
from tmux-resurrect.
Hi @bruno- , yes I think having that feature would help. Anyway, I thought a feature that is almost similar to that already exists? I saw this in the docs:
set -g @resurrect-processes 'some_program "git log"'
and
set -g @resurrect-processes 'irb pry "~rails server" "~rails console"'
I also tried them btw but it didn't solved the issue. There was no output unlike the setting I used on my 1st comment - #32 (comment)
set -g @resurrect-processes '"grunt development"'
and
set -g @resurrect-processes '"~grunt development"'
from tmux-resurrect.
Yea, those features are similar, but not really what we need here.
Okay, I'll work on a feature that will hopefully help with this and then let you know.
from tmux-resurrect.
Hi, this feature should now be implemented.
So you can:
-
update the plugin (
prefix + U
if you havetpm
installed) -
set the following option (pls take care of quoting, single quotes outside, double quotes "inside"):
set -g @resurrect-processes '"grunt->grunt development"'
Now, when grunt
program is restored, the plugin will invoke grunt development
command.
Let me know if it works!
from tmux-resurrect.
Have you tried save/restore the whole command instead of the process? Grunt is a bad example because it eats up the arguments. git log develop -20
gets restarted as git log
instead. When you use the command you can restore the exact thing you started before. You get the command by ps --pid $pane_pid -o cmd
. For grunt, someone can easily use a simple wrapper script, e.g.:
#! /bin/sh
grunt $*
from tmux-resurrect.
I just tested the command git log master -20
command and it got both saved and restored properly with all the arguments.
I'd love to improve the "process" for saving commands! Currently this is pretty isolated in this function here. I encourage you to submit a pull request that improves on that. Also feel free to ask related questions if there's any.
from tmux-resurrect.
@bruno- For some reason, it still doesn't work. Here's the contents of ~/.tmux/resurrect/last:
pane 0 0 :node 1 :* 0 :/Users/johnkevinmbasco/Vagrant/salt_basic/bitlock-angular 1 node :grunt ARCHFLAGS=-arch i386 -arch x86_64 Apple_PubSub_Socket_Render=/tmp/launch-RoJZ9c/Render
window 0 0 1 :* c8bd,156x37,0,0,0
state 0
Here's my tmux.conf:
# List of plugins
# Supports `github_username/repo` or full git URLs
set -g @tpm_plugins " \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
"
set -g @resurrect-processes '"grunt->grunt development"'
# initializes TMUX plugin manager
run-shell ~/.tmux/plugins/tpm/tpm
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
set -g default-terminal "xterm"
from tmux-resurrect.
I just tested the command
git log master -20
command and it got both saved and restored properly with all the arguments.
It doesn't work here :( I created a new issue #43
from tmux-resurrect.
@basco-johnkevin thanks for the patience with this.
Your .tmux.conf
looks fine.
I tested restoring the state with the content of ~/.tmux/resurrect/last
you provided and grunt
also wasn't restoring for me!
After a while, I realized what's the problem:
- when you kill tmux server and start it again, tmux opens session 0 with window 0 by default
- now when you try to restore saved environment,
tmux-restore
will not restore session 0 and window 0 because it is already created! It also won't restore programs in that window - and this is why 'grunt' is not restored.
The above is actually considered to be a feature that makes tmux-resurrect
idempotent. You can hit "tmux restore key" multiple times in the same tmux session, but the restore will happen only the first time.
Here are the steps to solve the problem and test if grunt is restoring properly:
- run grunt program in any pane except in 'session 0/window 0'
- save tmux environment
- kill tmux
- start tmux and restore the last environment
Hopefully it works for you now!
from tmux-resurrect.
Any updates on this @basco-johnkevin ?
It should work now!
from tmux-resurrect.
Hey guys, I'm doing a small issues cleanup. This feature seems to work now, please reopen or report again if you find any issues.
from tmux-resurrect.
Related Issues (20)
- Ressurect only named sessions
- .tmux/resurrect directory not created HOT 1
- Restores wrong PWD when it's a symbolic link HOT 1
- resurrect files not saving expected data
- Save env variables as well
- Restoring non-existing directories
- Save problems
- Tests failing on clean checkout from master. HOT 1
- Description in document save_dir.md is not complete
- Problem recreate windows
- How to start tmux server with resurrect
- resurrect creates minimal sized horizontal splits
- Resurrect not saving the tmux session as intended HOT 2
- C-b C-r to restore session will end up with [exited] from tmux client on iSH(iOS alpinelinux)
- Login shell not invoked for zsh
- [Question] Create new sessions/windows/layouts using a file - supported?
- [BUG] saving with nvim opens the incorrect files if you have spaces in filenames
- How to upgrade from 3.0 and keep saved sessions ?
- [Bug] Restoring sessions is adding a new empty prompts everytime
- [BUG] Hooks pre-restore-all and post-restore-all don't work correctly with tmux v3.4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmux-resurrect.