如何发送M-.到终端(多术语)



我正在尝试将命令M-.(即<ALT> .)发送到Emacs中以多术语运行的终端。作为参考,M-.通常绑定在终端中插入前一个命令的最后一个参数(即yank-last-arg/insert-last-argument)

我做了如下设置:

(require 'multi-term)
(multi-term-keystroke-setup)
(setq multi-term-program "/home/john/sw/zsh/bin/zsh")
(setq term-bind-key-alist
    (list
    ( cons "C-c C-j" 'term-line-mode)
    ( cons "C-c C-k" 'term-char-mode)
    ( cons "C-p"  'term-send-raw)
    ( cons "C-n"  'term-send-raw)
    ( cons "C-a"  'term-send-raw)
    ( cons "C-e"  'term-send-raw)
    ( cons "M-b"  'term-send-backward-word)
    ( cons "M-f"  'term-send-forward-word)
    ( cons "M-d"  'term-send-forward-kill-word)
    ( cons "C-k"  'term-send-raw)
))
)
# Make sure yanking works:
(add-hook 'term-mode-hook (lambda ()
                            (define-key term-raw-map (kbd "C-y") 'term-paste)))

我试过添加:

( cons "M-."  'term-send-raw)

但它似乎没有做任何事情。

如果有用的话,下面是term.el

中定义的似乎有术语前缀的命令列表
term-send-M-x
term-send-backspace
term-send-backward-kill-word
term-send-backward-word
term-send-del
term-send-down
term-send-end
term-send-eof
term-send-forward-kill-word
term-send-forward-word
term-send-home
term-send-input
term-send-insert
term-send-invisible
term-send-left
term-send-next
term-send-prior
term-send-quote
term-send-raw
term-send-raw-meta
term-send-reverse-search-history
term-send-right
term-send-up

我没有multi-term来测试它,但您可以尝试使用term-send-raw-meta代替term-send-raw:

(setq term-bind-key-alist
    (list (cons "C-c C-j" 'term-line-mode)
          ; ...
          (cons "M-."  'term-send-raw-meta)))

相关内容

  • 没有找到相关文章

最新更新