-
Notifications
You must be signed in to change notification settings - Fork 12k
Open
Labels
bugSomething isn't workingSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows
Description
Description
Keyboard-based text selection does not work as expected in Windows. This seems to affect all terminals/shells.
- When using Shift+Left/Right arrows, only two characters can ever be selected; the two-character selection moves with the cursor thereafter
- When using Shift+Up/Down arrows, only one line can ever be selected; the selection moves with the cursor thereafter
- Regardless of selection method, pressing Backspace or Delete will only ever delete the single character immediately before/after the cursor
Unaffected:
- Mouse selection works as expected
- Copying a selected range (with right-click or Ctrl+C) works as expected
I have tried...
- Windows Terminal (my daily driver)
- cmd.exe directly
- Windows PowerShell directly
- VS Code integrated terminal
All exhibit the same behavior.
This likely has something to do with the fact that Windows shells implement this behavior natively, but that's pure speculation.
I used the following "action" config in Windows Terminal to get Shift+Enter to work for soft newlines:
{
"command": {
"action": "sendInput",
"input": "\u001b[13;2u"
},
"id": "User.sendInput.ShiftEnterCustom"
}Is there anything similar I could try to get the Shift+Arrow, Backspace or Delete keys to work?
Plugins
No response
OpenCode version
1.2.18
Steps to reproduce
- Type a line of text (e.g.,
Lorem ipsum dolor sit amet) - Pres Shift+LeftArrow four times to select "amet"
- Expected: "amet" is selected, with cursor blinking on the 'a'
- Actual: "am" is selected, with cursor blinking on 'a'
- Type a line of text (e.g.,
Lorem ipsum dolor sit amet) - Press Shift+Home to select the whole line (this works!)
- Press Delete
- Expected: The entire line of text is removed
- Actual: The 'L' is removed, leaving "orem ipsum dolor sit amet", unselected, cursor blinking on 'o'
- Type a line of text (e.g.,
Lorem ipsum dolor sit amet) - Press Home to move the cursor to the start of the line
- Press Shift+End to select the entire line (this works!)
- Press Backspace
- Expected: The entire line of text is removed
- Actual: The 't' at the end of "amet" is removed, leaving "Lorem ipsum dolor sit ame", unselected, cursor blinking at the end of the line
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows