An Emacs package to open an external terminal emulator in directories associated with the current buffer.
terminal-here-launch to start a terminal in the current directory.
(require 'terminal-here) (global-set-key (kbd "C-<f5>") #'terminal-here-launch) (global-set-key (kbd "C-<f6>") #'terminal-here-project-launch)
If the default command doesn't launch your preferred terminal you can configure it using these three variables:
The documentation for these variables gives a list of terminals with builtin support. If your terminal is in the list simply set the variable for your OS to the terminal of your choice. e.g.
(setq terminal-here-linux-terminal-command 'urxvt) (setq terminal-here-mac-terminal-command 'iterm2)
To use a terminal without builtin support, or to configure how your terminal is run, you can also set the variable to a list of strings specifying the command line which runs the terminal, e.g.
(setq terminal-here-linux-terminal-command '("urxvt" "-fade" "50"))
Terminal-here has out-of-the-box support for most platforms, but will work anywhere with some customisation.
Out-of-the-box support tested on:
- Ubuntu 16.04 (but should work identically on any Debian-based system)
- Windows 10
Should be supported out-of-the-box, but currently untested:
- Older versions of Windows
- Non-Debian-based Linux systems with a desktop environment (e.g. GNOME, KDE)
Requires configuration before use:
- Non-Debian-based UNIXes without a desktop environment (because there is no way to pick a good default terminal to use).
If you have problems just configure your terminal manually as described above.
terminal-here can run ssh to open terminals in remote directories for files
opened with tramp. For any of
the predefined terminal configurations this should work without any configuration.
For other terminals you will need to set
terminal-here-command-flag to the
command line flag which tells the terminal to treat the rest of the command line
as a separate command to run inside the terminal.
To support other operating systems the variable
can be used instead of the OS-specific variables listed above. If set it will
override other settings.
To support more complex terminals or selecting a terminal at runtime: you can set and of the custom variables to a function which accepts a launch directory argument and returns a list of strings specifying the command line which runs the terminal.
- Added support for simpler customisation by setting the terminal to a symbol from a list of supported terminal symbols.
- Allow simple configuration of different terminals on different operating systems.
- Improved selection of a default terminal for non-Debian Linux OSes.
- Out-of-the-box support for SSH on many more terminals.
There are lots of built in ways to run terminals inside emacs (
ansi-term, ...) but these can have problems like slow output speed
or incompatibility with existing configs. I currently prefer to run external
terminal emulators, YMMV.