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

Focus error : working with window managers (e.g dwm) on Linux #53

Open
vedshastry opened this issue Mar 13, 2023 · 0 comments · May be fixed by #54
Open

Focus error : working with window managers (e.g dwm) on Linux #53

vedshastry opened this issue Mar 13, 2023 · 0 comments · May be fixed by #54

Comments

@vedshastry
Copy link

vedshastry commented Mar 13, 2023

I am using dwm on Arch Linux, but I believe this issue might apply to most users working with window managers.

The selected codeblock does not run in Stata until I shift my focused window to Stata, upon which all the text is synced and sent. This is particular to a window manager workflow since only 1 window is considered to be 'in focus' at a time. On desktop environments, this issue does not exist.

I believe the problem is that sendCode.js currently uses the --sync flag on windowactivate.

  1. The selected codeblock is sent to clipboard
  2. The Stata window is activated
  3. Clipboard is pasted, and then the current window is activated again.

I have managed to get this working by modifying the following lines in lib/sendCode.js
Here is the diff for fixing this issue. This should not affect compatibility with desktop environments on Linux, but it will be great if this could be tested!

132,133c132,133
<         windowactivate --sync $stata_window \
<         key --clearmodifiers --delay 100 ctrl+v Return \
---
>         windowactivate $stata_window \
>         key --window $stata_window --clearmodifiers --delay 20 ctrl+v Return \
@vedshastry vedshastry linked a pull request Mar 13, 2023 that will close this issue
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 a pull request may close this issue.

1 participant