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 copy-paste appears in editor not terminal #7

Open
xavier630 opened this issue Aug 3, 2021 · 3 comments
Open

Terminal copy-paste appears in editor not terminal #7

xavier630 opened this issue Aug 3, 2021 · 3 comments

Comments

@xavier630
Copy link

xavier630 commented Aug 3, 2021

While typing in the terminal inside the IDE, if you copy or paste with Talon, it applies the copy or the paste to the editor window (the file contents view) rather than to the current position of the cursor in the terminal. This only seems to affect copying paste and inserting text works fine.

Talon v0.2.0-8
Latest knausj develop (August 2 2021)
Encountered on Pycharm (but expect it's the same on all Jetbrains IDES)
Pycharm info:

PyCharm 2021.1.2 (Community Edition)
Build #PC-211.7442.45, built on June 1, 2021
Runtime version: 11.0.11+9-b1341.57 x86_64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Registry: ide.balloon.shadow.size=0
Non-Bundled Plugins: com.github.anonfunc.vcidea (0.0.11), com.chrisrm.idea.MaterialThemeUI (6.6.0)
@anonfunc
Copy link
Owner

anonfunc commented Aug 3, 2021

All commands are executed in the context of the current editor. If you need behavior matching the paste shortcut, use the keyboard shortcut.

@anonfunc anonfunc closed this as completed Aug 3, 2021
@xavier630
Copy link
Author

xavier630 commented Aug 3, 2021

Sorry, just for my understanding, are we closing this because it's too difficult to do (in that case maybe it could remain open as a long-term FR) or because we don't want this behavior?

If we don't want this behavior, could you please elaborate a little about why just so that we're on the same page?

@anonfunc
Copy link
Owner

anonfunc commented Aug 3, 2021

I closed it because it seemed like a misunderstanding of the plugin and its role in coordination with your Talon scripts. I'll go ahead and re-open it.

The main purpose of this plugin is to run commands in the current active editor in a way that's keybinding agnostic. The remaining functionality is to either provide feedback to the driving Talon package or to implement commands from VoiceCode which are difficult to do without state. (PSI ranges, selecting forward/back, etc.)

This is why the original Talon contexts for IntelliJ tried to detect popup windows and dialogs so that normal commands are used instead. (Looking at the current knausj repo, all of that functionality seems to have been lost. You can test this by opening a modal and attempting to paste.)

Assuming you did modify this plugin to send commands to non-editor components, you'd also need to plumb that state back into Talon so you can send the correct commands. That is, EditorPaste vs Terminal.Paste.

And after all that, you would have built a paste command that does multiple RPC calls and lookups in order to emulate a subset of the behavior of pressing the original keyboard shortcut.

@anonfunc anonfunc reopened this Aug 3, 2021
hbk619 added a commit to hbk619/knausj_talon that referenced this issue Aug 13, 2021
As related to this issue
anonfunc/intellij-voicecode#7
when a non-editor window of a Jetbrains product is open we still
mark Jetbrains commands as active, meaning things like copy/paste
or 'clear line' go to the editor, rather than the popup window.

This was previously implemented using callbacks for the context in
the original Talon.
https://github.com/anonfunc/talon-user/blob/master/apps/jetbrains.py#L303

These have been replaced with scopes. The current scope updates when
the UI fires an event. This does mean if you open the 'actions' dialogue
(via the command please) then it doesn't trigger a UI update and the Jetbrains
context is still active. Other popups do. I'm not sure what the performance hit
would be running the check every second or two via cron so opted for this
instead
hbk619 added a commit to hbk619/knausj_talon that referenced this issue Aug 16, 2021
As related to this issue
anonfunc/intellij-voicecode#7
when a non-editor window of a Jetbrains product is open we still
mark Jetbrains commands as active, meaning things like copy/paste
or 'clear line' go to the editor, rather than the popup window.

This was previously implemented using callbacks for the context in
the original Talon.
https://github.com/anonfunc/talon-user/blob/master/apps/jetbrains.py#L303

These have been replaced with scopes. The current scope updates when
the UI fires an event. This does mean if you open the 'actions' dialogue
(via the command please) then it doesn't trigger a UI update and the Jetbrains
context is still active. Other popups do. I'm not sure what the performance hit
would be running the check every second or two via cron so opted for this
instead
hbk619 added a commit to hbk619/knausj_talon that referenced this issue Mar 22, 2022
As related to this issue
anonfunc/intellij-voicecode#7
when a non-editor window of a Jetbrains product is open we still
mark Jetbrains commands as active, meaning things like copy/paste
or 'clear line' go to the editor, rather than the popup window.

This was previously implemented using callbacks for the context in
the original Talon.
https://github.com/anonfunc/talon-user/blob/master/apps/jetbrains.py#L303

These have been replaced with scopes. The current scope updates when
the UI fires an event. This does mean if you open the 'actions' dialogue
(via the command please) then it doesn't trigger a UI update and the Jetbrains
context is still active. Other popups do. I'm not sure what the performance hit
would be running the check every second or two via cron so opted for this
instead
hbk619 added a commit to hbk619/knausj_talon that referenced this issue May 25, 2022
As related to this issue
anonfunc/intellij-voicecode#7
when a non-editor window of a Jetbrains product is open we still
mark Jetbrains commands as active, meaning things like copy/paste
or 'clear line' go to the editor, rather than the popup window.

This was previously implemented using callbacks for the context in
the original Talon.
https://github.com/anonfunc/talon-user/blob/master/apps/jetbrains.py#L303

These have been replaced with scopes. The current scope updates when
the UI fires an event. This does mean if you open the 'actions' dialogue
(via the command please) then it doesn't trigger a UI update and the Jetbrains
context is still active. Other popups do. I'm not sure what the performance hit
would be running the check every second or two via cron so opted for this
instead
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

No branches or pull requests

2 participants