Skip to content

Conversation

@AmineGuitouni
Copy link

Problem: It's easy to accidentally exit opencode by pressing Ctrl+C once.

Proposed Solution: Require pressing Ctrl+C twice within 2 seconds to exit.
On first press, show a toast warning "Press again to exit".

Implementation: I have a working implementation ready if this is approved.

shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
…#4900)

Merge upstream PR sst#4900 from AmineGuitouni:
- Require pressing Ctrl+C twice within 2 seconds to exit
- Show warning toast on first press: 'Press again to exit'
- Prevents accidental exit during active sessions
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
Merged upstream PRs:
- sst#4898: Search in messages (Ctrl+F)
- sst#4791: Bash output viewer with ANSI color support
- sst#4900: Double Ctrl+C to exit
- sst#4709: Token counting fixes for synthetic/noReply messages

Updated README for shuvcode fork project.
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
* feat(tui): implement search functionality in session view

- Added a search input component to allow users to search through messages.
- Implemented logic to highlight search matches and navigate between them.
- Updated the theme syntax rules to include strikethrough styling.
- Enhanced message rendering to support search highlighting for text and markdown parts.


* feat(tui): add bash output viewer with ANSI color support

Adds an bash output viewer with full ANSI color support. When bash commands
produce more than 20 lines of output, users can click to expand into a
full-screen viewer with syntax highlighting and keyboard navigation.

Key features:
- Full ANSI/VT color rendering using opentui-ansi-vt terminal emulation
- Truncated preview (20 lines) with 'Click to view full output' expansion
- Prompt text preservation when entering/exiting viewer
- Force color output in bash commands (FORCE_COLOR, CLICOLOR, TERM env vars)

Technical changes:
- Added opentui-ansi-vt dependency for terminal buffer rendering
- Added initialValue prop to Prompt component to restore draft text
- Strip ANSI codes for search to match actual text content

* limit to MAX_OUTPUT_LENGTH

* remove ANSI from model output with ptyToText

* use 120 rows for terminal output

* chore: update opentui-ansi-vt to 1.2.7

* feat(tui): add page up/down support to bash output viewer

* fix(tui): improve match navigation and search highlighting

- Refactored match navigation logic to prevent scrolling to the same message when navigating through matches.
- Enhanced search highlighting to correctly identify and highlight query text within code blocks.
- Updated rendering of Assistant messages to include IDs for better scrolling functionality during searches.

* chore(tui-search): Removed active match differenciation, since we cant get it working in Assistant Messages (markdown)

* feat: implement double Ctrl+C to exit functionality with warning toast

* fix: improve token counting for synthetic and noReply messages (PR sst#4709)

Cherry-pick fix from upstream PR sst#4709 by arsham:
- Use 'ignored' flag instead of 'synthetic' for accurate token counts
- Fix sentEstimate formula to prevent double-counting tool result tokens
- Add null checks in calculateToolResultTokens for safety
- Prevents exponential growth from double-counting in session totals

* docs: update README for shuvcode fork

- Add header explaining this is a fork for PR integration testing
- Include table of merged PRs with upstream status
- Preserve original opencode documentation below

* changing sidebar version display to shuvcode
@shuv1337
Copy link
Contributor

shuv1337 commented Dec 2, 2025

@rekram1-node - this one has been really useful as well. i struggle with accidentally closing opencode way too much, especially since control-c also clears the prompt. this gives a nice buffer while retaining existing functionality

opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 11, 2025
Resolved conflicts:
- packages/opencode/package.json: Updated version to 1.0.150
- packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx: Accepted upstream changes, restored double Ctrl+C exit feature (PR sst#4900)
- packages/opencode/src/config/config.ts: Accepted upstream changes with super keybinds, preserved header_toggle and session_parent keybinds
- script/publish.ts: Preserved fork-specific comment
- .github/workflows/publish.yml: Removed (deleted in fork)
- packages/ui/src/components/input.css: Removed (deleted upstream)
- packages/ui/src/components/input.tsx: Removed (deleted upstream)
- bun.lock: Regenerated
- All package.json files: Accepted upstream version bumps
- Desktop, console, enterprise files: Accepted upstream

Preserved fork features:
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4865: session_parent keybind
- Fork feature: header_toggle keybind
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 11, 2025
Resolved conflicts:
- packages/opencode/package.json: Updated version to 1.0.150
- packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx: Accepted upstream changes, restored double Ctrl+C exit feature (PR sst#4900)
- packages/opencode/src/config/config.ts: Accepted upstream changes with super keybinds, preserved header_toggle and session_parent keybinds
- script/publish.ts: Preserved fork-specific comment
- .github/workflows/publish.yml: Removed (deleted in fork)
- packages/ui/src/components/input.css: Removed (deleted upstream)
- packages/ui/src/components/input.tsx: Removed (deleted upstream)
- packages/desktop/src/context/layout.tsx: Restored fork's font/theme support
- packages/desktop/src/components/font-picker.tsx: Updated to use new items function signature
- packages/desktop/src/components/theme-picker.tsx: Updated to use new items function signature
- bun.lock: Regenerated
- All package.json files: Accepted upstream version bumps
- Desktop, console, enterprise files: Accepted upstream

Preserved fork features:
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4865: session_parent keybind
- Fork feature: header_toggle keybind
- Fork feature: Desktop font and theme pickers
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 11, 2025
* wip: lander updates

* wip: lander updates

* wip: lander updates

* wip: lander updates

* ignore: Comment out plugin entry in opencode.jsonc

Comment out the plugin entry in opencode.jsonc

* chore: format code

* wip: downloads

* write typescript artifacts to node_modules/.ts-dist

* wip: lander hero updates

* wip: hero and nav updates

* ignore: update download stats 2025-12-11

* wip: lander updates

* fix: change terminal title to OpenCode

* chore: format code

* wip: add more items to download

* wip: add faq to download

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* fix: missing font

* fix: load fonts the right way

* wip: social share image

* tauri: always build cli in predev

* wip: update lander video

* Fix / Improve Github Eyes Reaction Removal (sst#5383)

* Add ripgrep to Docker image (sst#5379)

* fix bug causing windows builds to sometimes fail

* fix: inverted text colors

* allow custom mappings for all textarea actions via config

* chore: format code

* Update Nix flake.lock and hashes

* align default input keybinds

* ci: enable tauri desktop app to be published with GitHub release ID and tag name

* release: v1.0.147

* chore: format code

* fix share image

* ci: fix tauri release asset naming to use opencode-desktop-[platform]-[arch][ext] format

* release: v1.0.148

* chore: format code

* temporarily remove undo/redo keybinds

* release: v1.0.149

* ci: use Blacksmith runners for Linux and Windows Tauri builds to improve build performance

* chore: format code

* fix: free cta

* wip: avatar colors

* ci

* chore: format code

* ci: install libglib2.0-dev on Blacksmith Linux runners to fix missing glib-2.0 system library error

* fix super modifier parsing

* chore: format code

* ci: fix Ubuntu host detection in Tauri build workflow

* wip: lander updates

* chore: format code

* ci

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* fix: Writing to Bun.stderr causes CPU pinning to 100%. (sst#5396)

* fix

* ci

* release: v1.0.150

* sync: merge upstream v1.0.150 into integration

Resolved conflicts:
- packages/opencode/package.json: Updated version to 1.0.150
- packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx: Accepted upstream changes, restored double Ctrl+C exit feature (PR sst#4900)
- packages/opencode/src/config/config.ts: Accepted upstream changes with super keybinds, preserved header_toggle and session_parent keybinds
- script/publish.ts: Preserved fork-specific comment
- .github/workflows/publish.yml: Removed (deleted in fork)
- packages/ui/src/components/input.css: Removed (deleted upstream)
- packages/ui/src/components/input.tsx: Removed (deleted upstream)
- packages/desktop/src/context/layout.tsx: Restored fork's font/theme support
- packages/desktop/src/components/font-picker.tsx: Updated to use new items function signature
- packages/desktop/src/components/theme-picker.tsx: Updated to use new items function signature
- bun.lock: Regenerated
- All package.json files: Accepted upstream version bumps
- Desktop, console, enterprise files: Accepted upstream

Preserved fork features:
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4865: session_parent keybind
- Fork feature: header_toggle keybind
- Fork feature: Desktop font and theme pickers

* chore: format code

---------

Co-authored-by: David Hill <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Brendan Allan <[email protected]>
Co-authored-by: Adam <[email protected]>
Co-authored-by: Daniel Polito <[email protected]>
Co-authored-by: GDR! <[email protected]>
Co-authored-by: Dax Raad <[email protected]>
Co-authored-by: Sebastian Herrlinger <[email protected]>
Co-authored-by: opencode <[email protected]>
Co-authored-by: Shantur Rathore <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 11, 2025
This merge brings upstream changes while preserving fork-specific features:

Preserved fork features:
- PR sst#4898: Search in messages (Ctrl+F)
- PR sst#4791: Bash output with ANSI colors
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4709: Live token usage during streaming
- PR sst#4865: Subagents sidebar with clickable navigation
- PR sst#4515: Show plugins in /status
- Fork-only: Toggle session header visibility

Resolved conflicts:
- Package versions updated to upstream v1.0.149
- Keybind type changes (cmd -> super)
- Desktop context files updated with defensive API checks
- UI components updated for new items prop signature
- input.css/tsx renamed to text-field.css/tsx

Validation:
- All typechecks pass (12/12 packages)
- All tests pass (281 passed, 1 skipped)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 18, 2025
Resolved conflicts:
- bun.lock: Regenerated from scratch
- packages/*/package.json: Accept upstream version (1.0.167)
- packages/extensions/zed/extension.toml: Accept upstream version

Upstream changes include:
- Version bump to 1.0.167
- Terminal title toggle feature added to config
- MCP authentication improvements
- Legal pages (privacy policy, terms of service)
- Tauri package updates

Fork features preserved:
- PR sst#4898: Search in messages (Ctrl+F)
- PR sst#4791: ANSI bash output support
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4709: Live token usage during streaming
- PR sst#4865: Subagents sidebar navigation
- PR sst#4515: Show plugins in /status
- PR sst#5508: Cache management commands
- PR #ariane-emory: Granular file permissions
- PR #fork-140: Toggle transparent background
- Desktop features: slash commands, shell mode, themes, branding
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 19, 2025
Resolved conflicts:
- script/publish.ts: kept fork version (fork-specific publishing to Latitudes-Dev/shuvcode)

Auto-merged files with upstream improvements:
- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx: new dialog-subagent component
- packages/opencode/src/session/message-v2.ts: improved error handling
- packages/desktop/src/context/global-sync.tsx: added null directory guards

Preserved fork features:
- PR sst#4898: Search in messages (Ctrl+F)
- PR sst#4791: Bash output with ANSI
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4709: Live token usage during streaming
- PR sst#4865: Subagents sidebar with clickable navigation
- PR sst#5508: Cache management command
- Glob permissions feature
- Toggle transparent background
- Desktop slash commands and share functionality
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 19, 2025
Resolved conflicts:
- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx: Merged fork search highlighting with upstream user message markdown toggle
- packages/opencode/package.json: Accept upstream v1.0.170, preserved ghostty-opentui dependency
- .github/workflows/generate.yml: Keep fork-specific workflow (better error messaging)
- script/publish.ts: Keep fork-specific publish script (shuvcode registry, contributors)
- packages/extensions/zed/extension.toml: Accept upstream v1.0.170
- All other package.json files: Accept upstream v1.0.170 versions
- bun.lock: Regenerated

Preserved fork features:
- PR sst#4898: Search in messages (Ctrl+F with highlighting)
- PR sst#4791: Bash output with ANSI (ghostty-opentui)
- PR sst#4900: Double Ctrl+C to exit
- PR sst#4709: Live token usage during streaming
- PR sst#4865: Subagents sidebar with clickable navigation
- PR #fork-140: Toggle transparent background
- Fork: Toggle session header visibility
- Fork: Desktop slash commands and shell input mode
- Fork: Desktop Night Owl theme
- Fork: Desktop theme/font pickers and branding
- Fork: Share functionality for shuv.ai
- Fork: Desktop mobile responsiveness
- Fork: Desktop review pane resizing

New upstream feature integrated:
- User message markdown toggle (enable/disable markdown rendering in user messages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants