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

Terminal improperly handles paste events (Linux) #10724

Open
colin-grant-work opened this issue Feb 8, 2022 · 1 comment
Open

Terminal improperly handles paste events (Linux) #10724

colin-grant-work opened this issue Feb 8, 2022 · 1 comment
Labels
bug bugs found in the application navigator issues related to the navigator/explorer terminal issues related to the terminal

Comments

@colin-grant-work
Copy link
Contributor

colin-grant-work commented Feb 8, 2022

Bug Description:

In the Electron application on Linux, a terminal will inappropriately handle a paste command directed at the navigator. I cannot reproduce the behavior on MacOS.

Steps to Reproduce:

  1. Open the navigator widget.
  2. Open a terminal widget and focus it.
  3. Use the context menu copy command on a file node in the navigator tree
  4. Use the context menu paste command on a folder node in the navigator tree
  5. Observe that the URI of the file is pasted in the terminal widget, and the file is not pasted in the folder.

Additional Information

The problem seems due to our use of the document.execCommand API. When the terminal widget is focused, it creates a textarea element to handle input, and when we use the execCommand method to execute a paste action, the textarea is prioritized to handle the event since it is editable, and xterm's event handler calls stopPropagation. Setting the contenteditable property on the navigator widget's node to 'true' allows it to be prioritized over the terminal's input and fixes the bad behavior, but doesn't seem like the right move.

  • Operating System: Ubuntu 20.04 & RHEL7, Electron application
  • Theia Version: master (37ed897)
@colin-grant-work colin-grant-work added bug bugs found in the application terminal issues related to the terminal navigator issues related to the navigator/explorer labels Feb 8, 2022
@tsmaeder
Copy link
Contributor

tsmaeder commented Jan 4, 2024

Related: #2171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application navigator issues related to the navigator/explorer terminal issues related to the terminal
Projects
None yet
Development

No branches or pull requests

2 participants