about summary refs log tree commit diff
path: root/users
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-05-10T14·13+0200
committerclbot <clbot@tvl.fyi>2022-05-10T18·18+0000
commit1e3306ab574ab1faf13e7735b0d56bf5dd9c7f21 (patch)
treeedb3aa7e81e5ef01e12392efe8d88378096e9be0 /users
parent2f74626718ee499b30c4a8447983ae0057b44b40 (diff)
feat(sterni/emacs): use bash login shell for M-x shell r/4053
bash (unlike fish) doesn't break down if TERM=dumb which is the only one
I'll be using in emacs (I want to reduce my usage of things depending on
ANSI escape sequence to a minimum, for stuff that needs it I still have
foot). bash is started in login shell mode so /etc/profile is sourced
which will a) enable direnv support and b) setup some tweaks (relating
to PAGER etc.) if TERM=dumb.

Since I use a semicolon for a prompt in (ba)sh, shell-prompt-pattern
needs to be adjusted.

Change-Id: If58b6d1edf1d9ab1883cb51c27729e23d889b16c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5570
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users')
-rw-r--r--users/sterni/emacs/default.nix7
-rw-r--r--users/sterni/emacs/init.el5
2 files changed, 12 insertions, 0 deletions
diff --git a/users/sterni/emacs/default.nix b/users/sterni/emacs/default.nix
index 67851d81b04b..67f2409ad5bc 100644
--- a/users/sterni/emacs/default.nix
+++ b/users/sterni/emacs/default.nix
@@ -52,6 +52,13 @@ let
                 languagetool-server-command "${pkgs.languagetool}/share/languagetool-server.jar"
                 languagetool-java-arguments '("-Dfile.encoding=UTF-8"))
 
+          ;; use bash instead of fish from SHELL for some things, as it plays
+          ;; nicer with TERM=dumb, as I don't need/want vterm anyways.
+          ;; We want it to source /etc/profile for some extra setup that
+          ;; kicks in if TERM=dumb, meaning we can't use dash/sh mode.
+          (setq shell-file-name "${pkgs.bash}/bin/bash"
+                explicit-bash-args '("-l"))
+
           (provide 'nix-inject)
         '';
       })
diff --git a/users/sterni/emacs/init.el b/users/sterni/emacs/init.el
index f3942c2f0f2b..4e2baef921f3 100644
--- a/users/sterni/emacs/init.el
+++ b/users/sterni/emacs/init.el
@@ -114,6 +114,11 @@
 ;; man
 (setq Man-notify-method 'pushy) ; display man page in current window
 
+;; shell
+
+; default, but allows ';' as prompt
+(setq shell-prompt-pattern "^[^#$%>;\n]*[#$%>;] *")
+
 ;;; Configure packages
 (require 'use-package)