atom-terminal-tab icon indicating copy to clipboard operation
atom-terminal-tab copied to clipboard

Enable basic keyboard navigation

Open max-sixty opened this issue 7 years ago • 5 comments

Thanks for the package! This could be the start of something compelling.

Are the following possible with the keyboard?

  • Navigate to an existing terminal from the editor
  • Navigate back to the editor from a terminal
  • Toggle the terminal dock open & closed

At the moment, I've made some hacky changes to my keyboard mapping to get some of the way there, but it's not pretty

Additionally, cmd-shift-t is a already a heavily used keyboard shortcut - there are hundreds of other alternatives.

Tangentially related to: https://github.com/jsmecham/atom-terminal-tab/issues/18

max-sixty avatar Feb 08 '18 04:02 max-sixty

Here are a couple of scripts I've added to my init.coffee to enable some of this. (I'm learning as I go, so please correct me if there are errors / easier ways to do this)


atom.commands.add 'atom-workspace',
  # return focus on editor
  'custom:focus-on-editor': ->
    atom.views.getView(atom.workspace.getActiveTextEditor()).focus()

atom.commands.add 'atom-workspace',
  # either focus on the currently open terminal, or open a new one if there isn't one visible
  # (this will create an new instance if there's one open but hidden, which may not be intended)
  'custom:terminal-focus-or-new': ->
    pane = atom.workspace.getBottomDock().getActivePane()
    if pane.activeItem.getTitle() == 'Terminal'
      pane.focus()
    else
      editorElement = atom.views.getView(atom.workspace.getActiveTextEditor())
      atom.commands.dispatch(editorElement, 'terminal:open')

max-sixty avatar Feb 08 '18 23:02 max-sixty

My next focus of work is going to be on key bindings and compatibility. See #66 where I will be tracking this work. Thanks!

jsmecham avatar Feb 12 '18 00:02 jsmecham

@jsmecham

tree-view uses a simple escape keybinding to return focus to the workspace (panes) area.

https://github.com/atom/tree-view/issues/1113

That would be really nice to have in this package.

sfeldkamp avatar Jul 31 '18 15:07 sfeldkamp

@sfeldkamp that will break stuff for anyone who uses vi bindings in their shell, and most (all?) shells support vi bindings (e.g. bash, zsh, fish).

jasmith79 avatar Nov 02 '18 12:11 jasmith79

+1 This is a very important feature in my opinion

charleswilmot avatar Mar 03 '21 15:03 charleswilmot