kyagi / shell-pop-el

shell-pop.el helps you to use shell easily on Emacs. Only one key action to work.
212 stars 21 forks source link

Feature request: configure different keybindings for different types of shell #40

Open justmytwospence opened 9 years ago

justmytwospence commented 9 years ago

Incredibly useful package here, thanks. It would be even more useful if I could easily configure one keybinding for an eshell and another for a terminal emulator, for example. Is there an easy way to configure that with the current state of the package?

syohex commented 9 years ago

Is there an easy way to configure that with the current state of the package?

No. There is no way. We can use two shells with following configuration, but we cannot use them simultaneously.

(defun shell-pop-eshell ()
  (interactive)
  (let ((shell-pop-shell-type '("eshell" "*eshell*" (lambda () (eshell))))
        (shell-pop-term-shell "eshell"))
    (shell-pop--set-shell-type 'shell-pop-shell-type shell-pop-shell-type)
    (call-interactively 'shell-pop)))

(defun shell-pop-shell ()
  (interactive)
  (let ((shell-file-name "/bin/bash")
        (shell-pop-shell-type '("shell" "*shell*" (lambda () (shell))))
        (shell-pop-term-shell "shell"))
    (shell-pop--set-shell-type 'shell-pop-shell-type shell-pop-shell-type)
    (call-interactively 'shell-pop)))

(global-set-key (kbd "M-e") 'shell-pop-eshell)
(global-set-key (kbd "M-a") 'shell-pop-shell)
Fuco1 commented 8 years ago

@justmytwospence you can use eyebrowse package and use a convention to always put your ansi-term on first workspace. Then just write a very simple "toggle current<->1" function. I've been using this with great success.

I still use shell-pop for the extreme convenience of directory tracking and just quickily getting in/out of my way. I use shell-pop with eshell so whenever I don't need full terminal.

azzamsa commented 6 years ago

No. There is no way. We can use two shells with following configuration, but we cannot use them simultaneously.

@syohex thanks. wors great for me.