Skip to content

Conversation

@ManojINaik
Copy link

@ManojINaik ManojINaik commented Dec 26, 2025

Related Issue

Resolves #531

Description

This PR adds a prompt stashing feature that allows users to temporarily save their typed input and restore it later. This is useful when you're typing a message but need to quickly send something else first.

New Key Bindings

Keybinding Action
Ctrl-S Stash current input (saves to stack, clears buffer)
Ctrl-R Restore most recently stashed input

Implementation Details

  • Uses a deque with maxlen=10 for bounded LIFO storage
  • 10KB size limit per stashed entry to prevent memory abuse
  • Stash is automatically cleared on session exit
  • Toast notifications provide user feedback on stash/restore actions
  • Shortcut hints ctrl-s: stash and ctrl-r: restore added to bottom toolbar

Testing

  • Manual testing: Start kimi, type text, use Ctrl-S/Ctrl-R to verify stash/restore
  • Syntax validation passed via python3 -m py_compile

Add prompt stashing feature to temporarily save typed input:

- Ctrl-S: Stash current input (saves to stack, clears buffer)
- Ctrl-R: Restore most recently stashed input

Security measures:
- Bounded deque with max 10 items to prevent memory growth
- 10KB limit per stashed entry
- Auto-cleared on session exit

This is useful when typing a message but needing to quickly
send something else first.
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.

Feature: Add prompt stashing (Ctrl-S/Ctrl-R)

1 participant