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

Do not let terminal take focus #40

Open
spbnick opened this issue Sep 20, 2017 · 8 comments
Open

Do not let terminal take focus #40

spbnick opened this issue Sep 20, 2017 · 8 comments

Comments

@spbnick
Copy link
Member

spbnick commented Sep 20, 2017

Now, since we have implemented all shortcuts in JavaScript, users don't need to send any keystrokes to tlog-play itself. Similarly, the future JavaScript-based player wouldn't need that. Therefore, we need to remove the ability of the terminal to take focus. Otherwise it captures keystrokes and masks them from the browser, which is confusing and annoying.

@spbnick spbnick added this to the First release milestone Sep 20, 2017
@sabbaka
Copy link

sabbaka commented Sep 22, 2017

I've made some research - so focus is highly pushed in term.js itself.
I've tried to catch mousedown events in both recordings and terminal - but anyway focus ends up in terminal div while there is a playback ( an active session ).

@spbnick
Copy link
Member Author

spbnick commented Sep 22, 2017

We'll need to somehow disable that. An optimal solution would be to have some sort of control over this in upstream code, and use that.

@spbnick
Copy link
Member Author

spbnick commented Sep 22, 2017

E.g. an initialization option, or run-time switch.

@spbnick
Copy link
Member Author

spbnick commented Sep 26, 2017

Another related thing: we need the terminal to display cursor even if it is not focused.

@sabbaka
Copy link

sabbaka commented Jan 9, 2018

xtermjs/xterm.js#891

@sabbaka
Copy link

sabbaka commented Jan 9, 2018

I've accomplished this by editing term.js

@sabbaka
Copy link

sabbaka commented Jan 9, 2018

In summary I am not very happy about this solution, but have not found else one.
To test it put replace your node_modules/term.js-cockpit/src/term.js.
term.zip

@sabbaka
Copy link

sabbaka commented Jan 9, 2018

And one more thing - focus is actually irrelevant, of course we might remove all related to handling key downs in term.js ( which of course won't be a good idea since we want to move to using xterm.js one day ), because our event handler for key down is reacting no matter of focus on terminal's div.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants