Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selection lost on keyup #349

Closed
wants to merge 1 commit into from
Closed

Fix selection lost on keyup #349

wants to merge 1 commit into from

Conversation

nicot
Copy link

@nicot nicot commented Nov 10, 2016

Fixes #348.

Currently, releasing a key destroys the selection, even a modifier key like shift or command. This leads to bugs like microsoft/vscode#15200. This does not change the behavior that inserting a character will remove the selection.

This is the same behavior that other terminals have.

@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2016

Thanks for looking into this @nicot! @parisk do you know why this was added originally? Perhaps about redirecting the focus from the element to the textarea or something?

@parisk
Copy link
Contributor

parisk commented Nov 12, 2016

@Tyriar yes, mostly because of that.

@parisk
Copy link
Contributor

parisk commented Nov 12, 2016

Thanks for your contribution @nicot! One thing that does not work in this PR, but used to work and works on my local terminal as well is:

  1. Select some text
  2. Copy
  3. Press Ctrl + V (or Cmd + V on your Mac)

I expected it to paste, but it didn't. Can you please take care of that before moving on?

@nicot
Copy link
Author

nicot commented Nov 14, 2016

@parisk: Whoah, that is definitely not good, I'm glad you caught that! Weirdly enough, I can't get that to happen on my computer running macOS in Safari, Firefox or Chrome.

What browser/OS are you running?

@parisk
Copy link
Contributor

parisk commented Nov 16, 2016

NP @nicot! I am on macOS Sierra Chrome.

@nicot
Copy link
Author

nicot commented Nov 16, 2016

I run the same system, and I can't reproduce the issue you're running into. Pasting is working fine for me.

I think pasting happens on keydown, not on keyup, so this shouldn't change anything there.

@parisk
Copy link
Contributor

parisk commented Nov 22, 2016

Could you please try in another browser as well or try disabling your add-ons?

I am still running into this issue and after running the following code in the console the issue goes away (along with the functionality of this PR 😅 ):

term.element.addEventListener('keyup', term.focus.bind(term));

Update: I am always testing upon the plain demo.

@nicot
Copy link
Author

nicot commented Nov 22, 2016

I can't reproduce this at all! I've tried three different browsers, in Incognito mode and with extensions disabled. I'll close this PR, as I can't debug this issue further without reproducing it.

@nicot nicot closed this Nov 22, 2016
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.

3 participants