Skip to content

Add ctrl+w input support to lms chat#418

Closed
neilmehta24 wants to merge 1 commit intomainfrom
neil/lms-chat-ctrl-w
Closed

Add ctrl+w input support to lms chat#418
neilmehta24 wants to merge 1 commit intomainfrom
neil/lms-chat-ctrl-w

Conversation

@neilmehta24
Copy link
Copy Markdown
Member

Add support for ctrl+w to delete the word before the cursor. This binding is widely supported in terminals and cli tools.

I tested this implementation, and seems to be working correctly. Also, see the unit tests which further describe the behavior of ctrl+w depending on the cursor position and text.

ctrl+w is not allowed to delete pasted segments.

@neilmehta24 neilmehta24 requested review from rugvedS07 and yagil January 7, 2026 21:21
@github-actions github-actions bot added the CLA signed Indicates if all contributors have signed the CLA label Jan 7, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bceae355e3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +374 to +376
let wordStart = wordEnd;
while (wordStart > 0 && !/\s/.test(textBeforeCursor[wordStart - 1])) {
wordStart--;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat punctuation as word boundaries in Ctrl+W

The new Ctrl+W reducer only checks \s to find word boundaries, so punctuation like /, ,, or - is treated as part of the word and gets deleted. That contradicts the function’s own docstring (“treating spaces and punctuation as word boundaries”) and typical terminal behavior where Ctrl+W stops at punctuation (e.g., /usr/local/bin should leave /usr/local/). As written, Ctrl+W will erase entire paths or flags containing punctuation, which is likely unexpected for users relying on terminal-like word deletion.

Useful? React with 👍 / 👎.

@neilmehta24
Copy link
Copy Markdown
Member Author

Superceded by #403

@neilmehta24 neilmehta24 closed this Jan 8, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA signed Indicates if all contributors have signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant