You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/restoring_programs.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,13 +104,13 @@ Here's the general workflow for figuring this out:
104
104
- Now that you know the full and the desired process string use tilde `~` and
105
105
arrow `->` in `.tmux.conf` to make things work.
106
106
107
-
### Working with NodeJS <aname="nodejs"></a>
107
+
### Working with NodeJS <aname="nodejs"></a>
108
108
If you are working with NodeJS, you may get some troubles with configuring restoring programs.
109
109
110
110
Particularly, some programs like `gulp`, `grunt` or `npm` are not saved with parameters so tmux-resurrect cannot restore it. This is actually **not tmux-resurrect's issue** but more likely, those programs' issues. For example if you run `gulp watch` or `npm start` and then try to look at `ps` or `pgrep`, you will only see `gulp` or `npm`.
111
111
112
-
To deal with these issues, one solution is to use [yarn](https://yarnpkg.com/en/docs/install) which a package manager for NodeJS and an alternative for `npm`. It's nearly identical to `npm` and very easy to use. Therefore you don't have to do any migration, you can simply use it immediately. For example:
113
-
-`npm test` is equivalent to `yarn test`,
112
+
To deal with these issues, one solution is to use [yarn](https://yarnpkg.com/en/docs/install) which a package manager for NodeJS and an alternative for `npm`. It's nearly identical to `npm` and very easy to use. Therefore you don't have to do any migration, you can simply use it immediately. For example:
113
+
-`npm test` is equivalent to `yarn test`,
114
114
-`npm run watch:dev` is equivalent to `yarn watch:dev`
115
115
- more interestingly, `gulp watch:dev` is equivalent to `yarn gulp watch:dev`
116
116
@@ -124,11 +124,11 @@ It's fairly straight forward if you have been using `yarn` already.
124
124
125
125
126
126
#### npm
127
-
Instead of
127
+
Instead of
128
128
129
129
set -g @resurrect-processes '"~npm run watch"' # will NOT work
130
130
131
-
we use
131
+
we use
132
132
133
133
set -g @resurrect-processes '"~yarn watch"' # OK
134
134
@@ -148,22 +148,22 @@ If you use `nvm` in your project, here is how you could config tmux-resurrect:
148
148
149
149
set -g @resurrect-processes '"~yarn gulp test->nvm use && gulp test"'
150
150
151
-
#### Another problem
151
+
#### Another problem
152
152
Let take a look at this example
153
153
154
154
set -g @resurrect-processes '\
155
-
"~yarn gulp test->gulp test" \
155
+
"~yarn gulp test->gulp test" \
156
156
"~yarn gulp test-it->gulp test-it" \
157
157
'
158
-
**This will not work properly**, only `gulp test` is run, although you can see the command `node /path/to/yarn gulp test-it` is added correctly in `.tmux/resurrect/last` file.
158
+
**This will not work properly**, only `gulp test` is run, although you can see the command `node /path/to/yarn gulp test-it` is added correctly in `.tmux/resurrect/last` file.
159
159
160
160
The reason is when restoring program, the **command part after the dash `-` is ignored** so instead of command `gulp test-it`, the command `gulp test` which will be run.
161
161
162
162
A work around, for this problem until it's fixed, is:
163
163
- the config should be like this:
164
164
165
165
set -g @resurrect-processes '\
166
-
"~yarn gulp test->gulp test" \
166
+
"~yarn gulp test->gulp test" \
167
167
"~yarn gulp \"test-it\"->gulp test-it" \
168
168
169
169
- and in `.tmux/resurrect/last`, we should add quote to `test-it` word
0 commit comments