workon 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(echo \"TERM_PROGRAM: $TERM_PROGRAM\")",
5
+ "Bash(echo \"LC_TERMINAL: $LC_TERMINAL\")",
6
+ "Bash(echo \"ITERM_SESSION_ID: $ITERM_SESSION_ID\")",
7
+ "Bash(echo \"TERM: $TERM\")"
8
+ ],
9
+ "deny": []
10
+ }
11
+ }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.1.3](https://github.com/israelroldan/workon/compare/v2.1.2...v2.1.3) (2025-08-07)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Ensure tmux sessions spawn detached to avoid blocking ([5a98684](https://github.com/israelroldan/workon/commit/5a98684f535efac50cec1af011086adc957edd74))
11
+
12
+ ### [2.1.2](https://github.com/israelroldan/workon/compare/v2.1.1...v2.1.2) (2025-08-07)
13
+
5
14
  ### [2.1.1](https://github.com/israelroldan/workon/compare/v2.1.0...v2.1.1) (2025-08-07)
6
15
 
7
16
 
package/README.md CHANGED
@@ -176,7 +176,7 @@ workon myproject --shell
176
176
  Set up tab completion:
177
177
 
178
178
  ```bash
179
- workon --setup-completion
179
+ workon --completion
180
180
  ```
181
181
 
182
182
  ### Debug Mode
package/cli/index.js CHANGED
@@ -62,8 +62,8 @@ class workon extends container {
62
62
  me.log.setLogLevel('debug');
63
63
  }
64
64
 
65
- if (params['setup-completion']) {
66
- me.log.debug('Configuring command-line completion');
65
+ if (params.completion) {
66
+ me.log.debug('Setting up command-line completion');
67
67
  me.completion.setupShellInitFile();
68
68
  return true;
69
69
  } else if (params.init) {
@@ -164,11 +164,11 @@ workon.define({
164
164
  help: {
165
165
  '': 'Work on something great!',
166
166
  debug: 'Provide debug logging output',
167
- 'setup-completion': 'Configure command line tab completion (see help for details)',
167
+ completion: 'Configure and generate shell tab completion',
168
168
  shell: 'Output shell commands instead of spawning processes',
169
169
  init: 'Generate shell integration function for seamless directory switching'
170
170
  },
171
- switches: '[d#debug:boolean=false] [setup-completion:boolean=false] [shell:boolean=false] [init:boolean=false]',
171
+ switches: '[d#debug:boolean=false] [completion:boolean=false] [shell:boolean=false] [init:boolean=false]',
172
172
  commands: {
173
173
  '': 'open',
174
174
  interactive: {
package/lib/tmux.js CHANGED
@@ -77,12 +77,18 @@ class TmuxManager {
77
77
  // Create new tmux session with claude in the first pane (left side)
78
78
  await exec(`tmux new-session -d -s "${sessionName}" -c "${projectPath}" '${claudeCommand}'`);
79
79
 
80
- // Split window vertically - creates right side
80
+ // Split window vertically - creates right side (50/50 split)
81
81
  await exec(`tmux split-window -h -t "${sessionName}" -c "${projectPath}"`);
82
82
 
83
- // Split the right pane horizontally - creates top-right and bottom-right
83
+ // Split the right pane horizontally - creates top-right and bottom-right (50/50 split)
84
84
  await exec(`tmux split-window -v -t "${sessionName}:0.1" -c "${projectPath}" '${npmCommand}'`);
85
85
 
86
+ // Set remain-on-exit to keep pane open if command fails
87
+ await exec(`tmux set-option -t "${sessionName}:0.2" remain-on-exit on`);
88
+
89
+ // Resize panes to ensure npm pane is visible (give it at least 10 lines)
90
+ await exec(`tmux resize-pane -t "${sessionName}:0.2" -y 10`);
91
+
86
92
  // Set focus on claude pane (left pane)
87
93
  await exec(`tmux select-pane -t "${sessionName}:0.0"`);
88
94
 
@@ -103,6 +109,9 @@ class TmuxManager {
103
109
  // Split window vertically and run npm command in right pane
104
110
  await exec(`tmux split-window -h -t "${sessionName}" -c "${projectPath}" '${npmCommand}'`);
105
111
 
112
+ // Set remain-on-exit to keep pane open if command fails
113
+ await exec(`tmux set-option -t "${sessionName}:0.1" remain-on-exit on`);
114
+
106
115
  // Set focus on terminal pane (left pane)
107
116
  await exec(`tmux select-pane -t "${sessionName}:0.0"`);
108
117
 
@@ -115,10 +124,25 @@ class TmuxManager {
115
124
  // If we're already in tmux, switch to the session
116
125
  await exec(`tmux switch-client -t "${sessionName}"`);
117
126
  } else {
118
- // If not in tmux, attach to the session
119
- spawn('tmux', ['-CC', 'attach-session', '-t', sessionName], {
120
- stdio: 'inherit'
121
- });
127
+ // Check if iTerm2 integration is available
128
+ const isITerm = process.env.TERM_PROGRAM === 'iTerm.app' ||
129
+ process.env.LC_TERMINAL === 'iTerm2' ||
130
+ !!process.env.ITERM_SESSION_ID;
131
+ const useiTermIntegration = isITerm && !process.env.TMUX_CC_NOT_SUPPORTED;
132
+
133
+ if (useiTermIntegration) {
134
+ // Use iTerm2 tmux integration - spawn detached to avoid blocking
135
+ spawn('tmux', ['-CC', 'attach-session', '-t', sessionName], {
136
+ stdio: 'inherit',
137
+ detached: true
138
+ });
139
+ } else {
140
+ // Use regular tmux - spawn detached to avoid blocking
141
+ spawn('tmux', ['attach-session', '-t', sessionName], {
142
+ stdio: 'inherit',
143
+ detached: true
144
+ });
145
+ }
122
146
  }
123
147
  }
124
148
 
@@ -136,7 +160,9 @@ class TmuxManager {
136
160
  `tmux select-pane -t "${sessionName}:0.0"`,
137
161
  process.env.TMUX
138
162
  ? `tmux switch-client -t "${sessionName}"`
139
- : `tmux -CC attach-session -t "${sessionName}"`
163
+ : ((process.env.TERM_PROGRAM === 'iTerm.app' || process.env.LC_TERMINAL === 'iTerm2' || process.env.ITERM_SESSION_ID) && !process.env.TMUX_CC_NOT_SUPPORTED)
164
+ ? `tmux -CC attach-session -t "${sessionName}"`
165
+ : `tmux attach-session -t "${sessionName}"`
140
166
  ];
141
167
  }
142
168
 
@@ -152,10 +178,14 @@ class TmuxManager {
152
178
  `tmux new-session -d -s "${sessionName}" -c "${projectPath}" '${claudeCommand}'`,
153
179
  `tmux split-window -h -t "${sessionName}" -c "${projectPath}"`,
154
180
  `tmux split-window -v -t "${sessionName}:0.1" -c "${projectPath}" '${npmCommand}'`,
181
+ `tmux set-option -t "${sessionName}:0.2" remain-on-exit on`,
182
+ `tmux resize-pane -t "${sessionName}:0.2" -y 10`,
155
183
  `tmux select-pane -t "${sessionName}:0.0"`,
156
184
  process.env.TMUX
157
185
  ? `tmux switch-client -t "${sessionName}"`
158
- : `tmux -CC attach-session -t "${sessionName}"`
186
+ : ((process.env.TERM_PROGRAM === 'iTerm.app' || process.env.LC_TERMINAL === 'iTerm2' || process.env.ITERM_SESSION_ID) && !process.env.TMUX_CC_NOT_SUPPORTED)
187
+ ? `tmux -CC attach-session -t "${sessionName}"`
188
+ : `tmux attach-session -t "${sessionName}"`
159
189
  ];
160
190
  }
161
191
 
@@ -167,10 +197,13 @@ class TmuxManager {
167
197
  `tmux has-session -t "${sessionName}" 2>/dev/null && tmux kill-session -t "${sessionName}"`,
168
198
  `tmux new-session -d -s "${sessionName}" -c "${projectPath}"`,
169
199
  `tmux split-window -h -t "${sessionName}" -c "${projectPath}" '${npmCommand}'`,
200
+ `tmux set-option -t "${sessionName}:0.1" remain-on-exit on`,
170
201
  `tmux select-pane -t "${sessionName}:0.0"`,
171
202
  process.env.TMUX
172
203
  ? `tmux switch-client -t "${sessionName}"`
173
- : `tmux -CC attach-session -t "${sessionName}"`
204
+ : ((process.env.TERM_PROGRAM === 'iTerm.app' || process.env.LC_TERMINAL === 'iTerm2' || process.env.ITERM_SESSION_ID) && !process.env.TMUX_CC_NOT_SUPPORTED)
205
+ ? `tmux -CC attach-session -t "${sessionName}"`
206
+ : `tmux attach-session -t "${sessionName}"`
174
207
  ];
175
208
  }
176
209
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workon",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Work on something great!",
5
5
  "main": "index.js",
6
6
  "scripts": {