diff options
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | vterm.el | 28 |
2 files changed, 19 insertions, 22 deletions
@@ -16,6 +16,11 @@ Clone the repository: git clone https://github.com/akermu/emacs-libvterm.git ``` +Before install emacs-libvterm,you need make sure you have +installed + 1. cmake (>=3.0.2) + 2. libtool-bin related issues: [#66](https://github.com/akermu/emacs-libvterm/issues/66) [#85](https://github.com/akermu/emacs-libvterm/issues/85#issuecomment-491845136) + Run the build: ``` @@ -32,14 +37,6 @@ And add this to your `init.el`: (require 'vterm) ``` -If you want to have the module compiled, wrap the call to `require` as follows: - -``` -(add-to-list 'load-path "path/to/emacs-libvterm") -(let (vterm-install) - (require 'vterm)) -``` - # Debugging and testing If you have successfully build the module, you can test the module by executing @@ -39,13 +39,6 @@ ;; (require 'vterm) ;; ``` -;; If you want to have the module compiled, wrap the call to `require` as follows: - -;; ``` -;; (add-to-list 'load-path "path/to/emacs-libvterm") -;; (let (vterm-install) -;; (require 'vterm)) -;; ``` ;;; Code: @@ -61,20 +54,22 @@ (let ((default-directory (file-name-directory (locate-library "vterm")))) (unless (file-executable-p (concat default-directory "vterm-module.so" )) (let* ((buffer (get-buffer-create vterm-install-buffer-name)) - (status (call-process "sh" nil buffer t "-c" + status) + (pop-to-buffer vterm-install-buffer-name) + (setq status (call-process "sh" nil buffer t "-c" "mkdir -p build; \ cd build; \ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; \ - make"))) + make") ) (if (eq status 0) (message "Compilation of emacs-libvterm module succeeded") - (pop-to-buffer vterm-install-buffer-name) (error "Compilation of emacs-libvterm module failed!")))))) -(when (boundp 'vterm-install) - (vterm-module-compile)) -(require 'vterm-module) +(unless (require 'vterm-module nil t) + (vterm-module-compile) + (require 'vterm-module)) + (require 'subr-x) (require 'cl-lib) (require 'color) @@ -169,7 +164,7 @@ for different shell" (define-key vterm-mode-map [tab] #'vterm--self-insert) (define-key vterm-mode-map [backspace] #'vterm--self-insert) (define-key vterm-mode-map [M-backspace] #'vterm--self-insert) -(define-key vterm-mode-map [return] #'vterm--self-insert) +(define-key vterm-mode-map [return] #'vterm-send-return) (define-key vterm-mode-map [left] #'vterm--self-insert) (define-key vterm-mode-map [right] #'vterm--self-insert) (define-key vterm-mode-map [up] #'vterm--self-insert) @@ -228,6 +223,11 @@ for different shell" (interactive) (vterm-send-key "_" nil nil t)) +(defun vterm-send-return () + "Sends C-m to the libvterm." + (interactive) + (process-send-string vterm--process "\C-m")) + (defun vterm-yank () "Implementation of `yank' (paste) in vterm." (interactive) |
