I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #+TITLE: Terminal
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle terminal.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. Performing terminal interactions is a must-have for any modern editor. This module introduces *two* means of doing so with [[https://gnu.org/software/emacs/manual/html_node/eshell/index.html][EShell]][fn:1] and [[https://github.com/akermu/emacs-libvterm][VTerm]][fn:2].
  9. * Emacs Lisp shell
  10. *EShell*[fn:1] is a fully *POSIX* compliant shell written entirely in Emacs Lisp. While not a traditional terminal emulator, it provides a native REPL for Emacs Lisp code with everything available in the environment.
  11. + Don't highlight the prompt
  12. + Favour use of system utilities
  13. + Open in the current buffer with =SPC e=
  14. #+begin_src emacs-lisp
  15. (setq eshell-highlight-prompt nil
  16. eshell-prefer-lisp-functions nil)
  17. (dotfiles/leader "e" '(eshell :which-key "Shell"))
  18. #+end_src
  19. ** Prompt extras
  20. Implement the lambda prompt for aesthetic purposes with the [[https://github.com/zwild/eshell-prompt-extras][EShell Prompt Extras]][fn:3] package.
  21. #+begin_src emacs-lisp
  22. (use-package eshell-prompt-extras
  23. :custom (eshell-prompt-function 'epe-theme-lambda))
  24. #+end_src
  25. Here's an example of what that looks like:
  26. #+begin_example
  27. ~/.emacs.d/modules:main*? λ
  28. #+end_example
  29. * Interactive Terminal
  30. *EShell*[fn:1] isn't enough when needing interactivity from the terminal. Going through [[file:../docs/notes/thinking-in-cpp.org.gpg][Thinking in C++]][fn:4] for one of my courses required lots of terminal interaction which *Eshell*[fn:1] was unable to handle. *VTerm's*[fn:2] based on an external C library which is blazing fast, and fully interactive.
  31. + Always compile the module
  32. + Open in the current buffer with =SPC v=
  33. + Install the required packages on *Debian/Ubuntu*
  34. #+begin_src emacs-lisp
  35. (use-package vterm
  36. :commands (vterm)
  37. :custom (vterm-always-compile-module t)
  38. :config (dotfiles/leader "v" '(vterm-other-window :which-key "Terminal")))
  39. #+end_src
  40. * Footnotes
  41. [fn:1] https://gnu.org/software/emacs/manual/html_node/eshell/index.html
  42. [fn:2] https://github.com/akermu/emacs-libvterm
  43. [fn:3] https://github.com/zwild/eshell-prompt-extras
  44. [fn:4] https://chrishayward.xyz/posts/immutable-emacs/