Skip to content

Commit bf77722

Browse files
authored
feat: control d now exits the rli process (#45)
## Description <!-- Provide a brief description of your changes --> **Note:** PR titles should follow [Conventional Commits](https://www.conventionalcommits.org/) format (e.g., `feat(devbox): add support for custom env vars` or `fix(snapshot): resolve pagination issue`) as they are used for automatic release notes generation. ## Type of Change <!-- Mark the relevant option with an 'x' --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test updates ## Related Issues <!-- Link to related issues using #issue-number --> Closes # ## Changes Made <!-- Describe the changes in detail --> ## Testing <!-- Describe how you tested your changes --> - [ ] I have tested locally - [ ] I have added/updated tests - [ ] All existing tests pass ## Checklist - [ ] My code follows the code style of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published ## Screenshots (if applicable) <!-- Add screenshots to help explain your changes --> ## Additional Notes <!-- Any additional information that reviewers should know -->
1 parent d770bde commit bf77722

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

scripts/generate-command-docs.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ function generateDetailedCommandDocs(program) {
133133
const commandName = command.name();
134134
const commandAlias = command.aliases()[0] || null;
135135
const sectionTitleBase = commandName.charAt(0).toUpperCase() + commandName.slice(1);
136-
const aliasNote = commandAlias ? ` (alias: \`${commandAlias}\`)` : "";
137136

138137
const lines = [];
139-
lines.push(`### ${sectionTitleBase} Commands${aliasNote}`);
138+
// Use simple header text for predictable anchor slugs (e.g., "devbox-commands")
139+
lines.push(`### ${sectionTitleBase} Commands`);
140140
lines.push("");
141141
lines.push("<AccordionGroup>");
142142

@@ -417,16 +417,16 @@ export RUNLOOP_API_KEY=your_api_key_here
417417
## Command Groups
418418
419419
<CardGroup cols={2}>
420-
<Card title="Devbox" icon="server" href="#devbox-commands-alias-d">
420+
<Card title="Devbox" icon="server" href="#devbox-commands">
421421
Create, manage, and interact with devboxes
422422
</Card>
423-
<Card title="Snapshot" icon="camera" href="#snapshot-commands-alias-snap">
423+
<Card title="Snapshot" icon="camera" href="#snapshot-commands">
424424
Create and manage devbox snapshots
425425
</Card>
426-
<Card title="Blueprint" icon="diagram-project" href="#blueprint-commands-alias-bp">
426+
<Card title="Blueprint" icon="diagram-project" href="#blueprint-commands">
427427
Manage reusable devbox templates
428428
</Card>
429-
<Card title="Object" icon="box-archive" href="#object-commands-alias-obj">
429+
<Card title="Object" icon="box-archive" href="#object-commands">
430430
Upload and manage file objects
431431
</Card>
432432
</CardGroup>

src/hooks/useExitOnCtrlC.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Hook to handle Ctrl+C (SIGINT) consistently across all screens
2+
* Hook to handle Ctrl+C (SIGINT) and Ctrl+D (EOF) consistently across all screens
33
* Exits the program with proper cleanup of alternate screen buffer
44
*/
55
import { useInput } from "ink";
@@ -12,5 +12,10 @@ export function useExitOnCtrlC(): void {
1212
exitAlternateScreenBuffer();
1313
processUtils.exit(130); // Standard exit code for SIGINT
1414
}
15+
// Handle Ctrl+D (EOF) same as Ctrl+C
16+
if (key.ctrl && input === "d") {
17+
exitAlternateScreenBuffer();
18+
processUtils.exit(0); // Clean exit for EOF
19+
}
1520
});
1621
}

src/screens/SSHSessionScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function SSHSessionScreen() {
6969
{figures.play} Connecting to {devboxName}...
7070
</Text>
7171
<Text color={colors.textDim} dimColor>
72-
Press Ctrl+C or type exit to disconnect
72+
Press Ctrl+C, Ctrl+D, or type exit to disconnect
7373
</Text>
7474
</Box>
7575
<InteractiveSpawn

0 commit comments

Comments
 (0)