start-command 0.19.0 → 0.19.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # start-command
2
2
 
3
+ ## 0.19.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c84c1bb: fix: Always display session/container name in isolation output
8
+
9
+ When using isolation backends (screen, docker, tmux), the output now shows the actual session/container name that users need to reconnect to sessions, especially in detached mode. Previously, only the session UUID was shown, but users need the actual backend name to:
10
+ - Reconnect to detached screen sessions: `screen -r <name>`
11
+ - Attach to tmux sessions: `tmux attach -t <name>`
12
+ - View Docker container logs: `docker logs <name>`
13
+ - Remove containers: `docker rm -f <name>`
14
+
15
+ Fixes #67
16
+
3
17
  ## 0.19.0
4
18
 
5
19
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "start-command",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "Gamification of coding, execute any command with ability to auto-report issues on GitHub",
5
5
  "main": "src/bin/cli.js",
6
6
  "exports": {
package/src/bin/cli.js CHANGED
@@ -470,9 +470,10 @@ async function runWithIsolation(
470
470
  // Add isolation info to extra lines
471
471
  if (environment) {
472
472
  extraLines.push(`[Isolation] Environment: ${environment}, Mode: ${mode}`);
473
- }
474
- if (options.session) {
475
- extraLines.push(`[Isolation] Session: ${options.session}`);
473
+ // Always add the session name so users can reconnect to detached sessions
474
+ // This is important for screen, tmux, docker where the session/container name
475
+ // is different from the session UUID used for tracking (see issue #67)
476
+ extraLines.push(`[Isolation] Session: ${sessionName}`);
476
477
  }
477
478
  if (effectiveImage) {
478
479
  extraLines.push(`[Isolation] Image: ${effectiveImage}`);
package/test/cli.test.js CHANGED
@@ -122,3 +122,97 @@ describe('CLI basic behavior', () => {
122
122
  assert.ok(result.stdout.includes('Usage:'), 'Should display usage');
123
123
  });
124
124
  });
125
+
126
+ describe('CLI isolation output (issue #67)', () => {
127
+ const { isCommandAvailable } = require('../src/lib/isolation');
128
+
129
+ it('should display screen session name when using screen isolation', async () => {
130
+ if (!isCommandAvailable('screen')) {
131
+ console.log(' Skipping: screen not installed');
132
+ return;
133
+ }
134
+
135
+ const result = runCLI(['-i', 'screen', '--', 'echo', 'hello']);
136
+
137
+ // The output should contain the screen session name (in format screen-timestamp-random)
138
+ // Check that the session UUID is displayed
139
+ assert.ok(
140
+ result.stdout.includes('│ session'),
141
+ 'Should display session UUID'
142
+ );
143
+ // Check that screen isolation info is displayed
144
+ assert.ok(
145
+ result.stdout.includes('│ isolation screen'),
146
+ 'Should display screen isolation'
147
+ );
148
+ // Check that the actual screen session name is displayed (issue #67 fix)
149
+ assert.ok(
150
+ result.stdout.includes('│ screen screen-'),
151
+ 'Should display actual screen session name for reconnection (issue #67)'
152
+ );
153
+ });
154
+
155
+ it('should display tmux session name when using tmux isolation', async () => {
156
+ if (!isCommandAvailable('tmux')) {
157
+ console.log(' Skipping: tmux not installed');
158
+ return;
159
+ }
160
+
161
+ const result = runCLI(['-i', 'tmux', '--', 'echo', 'hello']);
162
+
163
+ // The output should contain the tmux session name
164
+ assert.ok(
165
+ result.stdout.includes('│ session'),
166
+ 'Should display session UUID'
167
+ );
168
+ assert.ok(
169
+ result.stdout.includes('│ isolation tmux'),
170
+ 'Should display tmux isolation'
171
+ );
172
+ // Check that the actual tmux session name is displayed (issue #67 fix)
173
+ assert.ok(
174
+ result.stdout.includes('│ tmux tmux-'),
175
+ 'Should display actual tmux session name for reconnection (issue #67)'
176
+ );
177
+ });
178
+
179
+ it('should display docker container name when using docker isolation', async () => {
180
+ const { canRunLinuxDockerImages } = require('../src/lib/isolation');
181
+
182
+ if (!canRunLinuxDockerImages()) {
183
+ console.log(
184
+ ' Skipping: docker not available or cannot run Linux images'
185
+ );
186
+ return;
187
+ }
188
+
189
+ const result = runCLI([
190
+ '-i',
191
+ 'docker',
192
+ '--image',
193
+ 'alpine:latest',
194
+ '--',
195
+ 'echo',
196
+ 'hello',
197
+ ]);
198
+
199
+ // The output should contain the docker container name
200
+ assert.ok(
201
+ result.stdout.includes('│ session'),
202
+ 'Should display session UUID'
203
+ );
204
+ assert.ok(
205
+ result.stdout.includes('│ isolation docker'),
206
+ 'Should display docker isolation'
207
+ );
208
+ assert.ok(
209
+ result.stdout.includes('│ image alpine:latest'),
210
+ 'Should display docker image'
211
+ );
212
+ // Check that the actual container name is displayed (issue #67 fix)
213
+ assert.ok(
214
+ result.stdout.includes('│ container docker-'),
215
+ 'Should display actual container name for reconnection (issue #67)'
216
+ );
217
+ });
218
+ });