Open terminal from emacs

emacskeyboard shortcuts

Is there a fast way (keyboard shortcut) to open a terminal emulator (in my case urxvt) in the same directory as the file in the current emacs buffer?

Best Answer

The combination M-! allows you to launch shell commands. You could use it to launch a separate urxvt.

M-! urxvt RET

I just tried it with xterm (I don't have urxvt) and it did open in the same directory as the file in the buffer.

If you want to define a shortcut add something similar in your init file:

(global-set-key (kbd "C-c s") (kbd "M-! urxvt RET"))

In my case I bound the shortcut to: Ctrl+C - S.

Related Question