- ;; Pass through C-c, C-x, and M-x for emaception.
- (delete "C-x" term-unbind-key-list)
- (delete "C-c" term-unbind-key-list)
- (delete "<ESC>" term-unbind-key-list)
+ ;; In a multi-term, we strip out any "-nw" or "--no-window-system"
+ ;; flags that are present in the EDITOR and VISUAL environment
+ ;; variables, to avoid getting trapped inside a double-emacs-nw.
+ (setq editor (getenv "EDITOR"))
+ (setq editor (replace-regexp-in-string " -nw" "" editor))
+ (setq editor (replace-regexp-in-string " --no-window-system" "" editor))
+ (setenv "EDITOR" editor)