↓ Skip to main content

Terminal Keys

·372 words·2 mins
The keys of the plugin

What it does
#

A terminal in Eclipse sends almost all keys to the shell. This is necessary for programs such as vi, emacs and bash, but you cannot use the usual workbench keys in the terminal. For example, F12 does not take you back to the editor, and Ctrl+M does not maximize the Terminal view.

This plugin adds these keys:

KeyWhereResult
Ctrl+`Editor or other viewActivates the Terminal view. If no terminal is open, opens the Launch Terminal dialog.
Ctrl+`TerminalActivates the last editor.
F12TerminalActivates the last editor.
Ctrl+MTerminalMaximizes or restores the Terminal view.

All other keys go to the shell as before.

Change the keys
#

The plugin uses the keys of three commands in Window > Preferences > General > Keys:

  • Toggle Terminal (new, Ctrl+` by default)
  • Activate Editor (F12 by default)
  • Maximize Active View or Editor (Ctrl+M by default)

When you change the key of one of these commands, the new key also works in the terminal. Then the shell does not get that key.

Tip: start the terminal in the project of the open file
#

In Window > Preferences > Terminal > Local Terminal, set Initial Working Directory to ${project_loc}. Then a terminal that you open with Ctrl+` from an editor starts in the project of the file in that editor.

The preference page checks the value when you type it. Click in an editor before you open the preferences, or the page shows an error because no file is selected.

Install
#

  1. In Eclipse, select Help > Install New Software…

  2. In Work with, type this address and press Enter:

    https://anydoby.com/eclipse
  3. Select Terminal Keys in the category anydoby Eclipse plugins.

  4. Click Next, accept the license (EPL-2.0) and click Finish.

  5. Restart Eclipse.

The plugin needs Java 21 or later and an Eclipse with the terminal in org.eclipse.terminal.* (Eclipse 4.41 or later is tested).

Notes
#

  • The shell does not get F12 and Ctrl+M. In a shell, Ctrl+M is the same as Enter. If a program in the terminal needs F12, remove the key of Activate Editor or give it a different key.
  • The Terminal view also has its own key to maximize it: Alt+Up.

Changelog
#

  • 1.0.0: first release