diff --git a/layers/+tools/shell/README.org b/layers/+tools/shell/README.org index 7078be70f..39006257d 100644 --- a/layers/+tools/shell/README.org +++ b/layers/+tools/shell/README.org @@ -22,6 +22,7 @@ - [[#configuration][Configuration]] - [[#default-shell][Default shell]] - [[#default-shell-position-width-and-height][Default shell position, width, and height]] + - [[#external-terminal-emulator][External terminal emulator]] - [[#set-shell-for-term-ansi-term-and-vterm][Set shell for term, ansi-term and vterm]] - [[#set-shell-for-multi-term][Set shell for multi-term]] - [[#width-of-the-shell-popup-buffers][Width of the shell popup buffers]] @@ -39,6 +40,7 @@ This layer configures the various shells available in Emacs. ** Features: - Shell integration +- Running external terminal emulator in current/project directory * Install To use this configuration layer, add it to your =~/.spacemacs=. You will need to @@ -144,6 +146,12 @@ your shell is positioned on the left or the right. shell-default-width 40))) #+END_SRC +** External terminal emulator +This layer supports opening an external terminal emulator using [[https://github.com/davidshepherd7/terminal-here][terminal-here]]. +By default =terminal-here= finds an appropriate default shell for you. +If this does not work please check the package documentation how to +change it. + ** Set shell for term, ansi-term and vterm The default shell can be set by setting the variable =shell-default-term-shell=. Default value is =/bin/bash=. @@ -280,7 +288,9 @@ Some advanced configuration is setup for =eshell= in this layer: | Key binding | Description | |-------------+------------------------------------------------------------| | ~SPC '​~ | Open, close or go to the default shell | -| ~SPC p '​~ | Open a shell in the project's root | +| ~SPC "​~ | Open external terminal emulator in current directory | +| ~SPC p '​~ | Open a shell in the project’s root | +| ~SPC p "​~ | Open external terminal emulator in project root | | ~SPC a s e~ | Open, close or go to an =eshell= | | ~SPC a s i~ | Open, close or go to a =shell= | | ~SPC a s m~ | Open, close or go to a =multi-term= | diff --git a/layers/+tools/shell/config.el b/layers/+tools/shell/config.el index 0d88ce56a..5d0ad35b7 100644 --- a/layers/+tools/shell/config.el +++ b/layers/+tools/shell/config.el @@ -27,7 +27,7 @@ (defvar shell-default-position 'bottom "Position of the shell. Possible values are `top', `bottom', `full', -`left' and `right'.") + `left' and `right'.") (defvar shell-default-height 30 "Height in percents for the shell window.") @@ -40,16 +40,16 @@ (defvar shell-enable-smart-eshell nil "If non-nil then `em-smart' is enabled. `em-smart' allows to quickly review -commands, modify old commands or enter a new one.") + commands, modify old commands or enter a new one.") (defvar shell-protect-eshell-prompt t "If non-nil then eshell's prompt is protected. This means that -movement to the prompt is inhibited like for `comint-mode' -prompts and the prompt is made read-only") + movement to the prompt is inhibited like for `comint-mode' + prompts and the prompt is made read-only") (defvar shell-default-full-span t "If non-nil, the `shell' buffer spans full width of a frame.") (defvar close-window-with-terminal nil "If non-nil, the window is closed when the terminal is stopped. -This is only applied to `term' and `ansi-term' modes.") + This is only applied to `term' and `ansi-term' modes.") diff --git a/layers/+tools/shell/packages.el b/layers/+tools/shell/packages.el index 527d669c4..ff06b452d 100644 --- a/layers/+tools/shell/packages.el +++ b/layers/+tools/shell/packages.el @@ -27,6 +27,7 @@ shell-pop (term :location built-in) xterm-color + terminal-here vi-tilde-fringe (vterm :toggle (not (spacemacs/system-is-mswindows))) )) @@ -293,6 +294,16 @@ (remove 'ansi-color-process-output comint-output-filter-functions)) (add-hook 'eshell-mode-hook 'spacemacs/init-eshell-xterm-color)))) +(defun shell/init-terminal-here () + :defer t + :init + (progn + (spacemacs/register-repl 'terminal-here 'terminal-here) + (spacemacs/set-leader-keys + "\"" 'terminal-here-launch + "p \"" 'terminal-here-project-launch) + )) + (defun shell/post-init-vi-tilde-fringe () (spacemacs/add-to-hooks 'spacemacs/disable-vi-tilde-fringe '(comint-mode-hook