jsmecham / atom-terminal-tab

Simple terminal for the Atom text editor.
https://atom.io/packages/terminal-tab
MIT License
142 stars 29 forks source link

Enable basic keyboard navigation #61

Open max-sixty opened 6 years ago

max-sixty commented 6 years ago

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

Are the following possible with the keyboard?

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 commented 6 years ago

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')
jsmecham commented 6 years ago

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

sfeldkamp commented 6 years ago

@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.

jasmith79 commented 5 years ago

@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).

charleswilmot commented 3 years ago

+1 This is a very important feature in my opinion