-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an experimental setting for moving the cursor with the mouse (#15758
) ## Summary of the Pull Request This adds a new experimental per-setting to the terminal. ```ts "experimental.repositionCursorWithMouse": bool ``` When: * the setting is on * AND you turn on shell integration (at least `133;B`) * AND you click is somewhere _after_ the "active command" mark we'll send a number of simulated keystrokes to the terminal based off the number of cells between the place clicked and where the current mouse cursor is. ## PR Checklist - [ ] Related to #8573. I'm not marking as _closed_, because we should probably polish this before we close that out. This is more a place to start. ## Detailed Description of the Pull Request / Additional comments There was a LOT of discussion in #8573. This is kinda a best effort feature - it won't always work, but it should improve the experience _most of the time_. We all kinda agreed that as much as the shell probably should be responsible for doing this, there's myriad reasons that won't work in practicality: * That would also disable selection made by the terminal. That's a hard sell. * We'd need to invent some new mouse mode to support click-to-reposition-but-drags-to-select-I-don't-want * We'd then need shells to adopt that functionality. And eventually settled that this was the least horrifying comprimise. This has _e d g e c a s e s_: * Does it work for wrapped lines? Well, kinda okay actually. * Does it work for `vim`/`emacs`? Nope. * Does it work for emoji/wide glyphs? I wouldn't expect it to! I mean, emoji input is messed up anyways, right? * Other characters like `ESC` (which are rendered by the shell as two cells "^[")? Nope. * Does it do selections? Nope. * Clicking across lines with continuation prompts? Nope. * Tabs? Nope. * Wraps within tmux/screen? Nope. https://github.com/xtermjs/xterm.js/blob/master/src/browser/input/MoveToCell.ts has probably a more complete implementation of how we'd want to generate the keypresses and such.
- Loading branch information
1 parent
a0c88bb
commit b556594
Showing
10 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters