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.

kcrommett 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
kcrommett 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.
kcrommett 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
@kcrommett
Copy link
Contributor

@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

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