Spiker985 / x-terminal-reloaded

An xterm based package for providing terminals inside your workspace.
https://web.pulsar-edit.dev/packages/x-terminal-reloaded
Other
9 stars 3 forks source link

Feature request: shortcut for "focus on terminal" #97

Open ndr-brt opened 10 months ago

ndr-brt commented 10 months ago

Hey, great work here so far!

It would be great to have a shortcut to focus the terminal, currently it's possible from the main menu but it's quite annoying to do it with the mouse.

tom-power commented 10 months ago

true story there's an action for x-terminal-reloaded:unfocus, but not x-terminal-reloaded:focus, wonder if it was on purpose or just missed?

I use window:toggle-bottom-dock for this btw so didn't know, might work for you in the meantime?

ndr-brt commented 10 months ago

putting this in the keymap.cson almost did the job:

'body':
  'alt-f12': 'window:toggle-bottom-dock'

the problem is that keymap does not work when the terminal has the focus, the x-terminal-reloaded:unfocus works only from the command menu (not with the shortcut) and I'm not sure where the focus goes, surely not on the editor (edit, looking at the code, the focus is given to the whole workspace). Isn't there a way to give the focus to the latest component that had it?

tom-power commented 10 months ago

don't know a way to find the last component, but could just use atom.workspace.getActiveTextEditor() and change focus to the editor, notice that's what happens with window:toggle-bottom-dock

for the keybinding xterm.js is swallowing alt-f12 right? I use a ctrl-` which works, though then run into this