summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-03-17 14:05:15 -0400
committerKjetil Orbekk <kj@orbekk.com>2023-03-17 14:05:15 -0400
commitabb9ed327f766c82e0d5d5060afc6cf8a4c88fdc (patch)
treed8edfa95c46939951bae1397b0fc8eb757693ac4 /emacs
parent173eb771e3138052952f4a16c59e86e1d3714794 (diff)
fix shell handling and C-t rebind
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.config/emacs-kj/init.el33
1 files changed, 17 insertions, 16 deletions
diff --git a/emacs/.config/emacs-kj/init.el b/emacs/.config/emacs-kj/init.el
index c26b876..fc47bc5 100644
--- a/emacs/.config/emacs-kj/init.el
+++ b/emacs/.config/emacs-kj/init.el
@@ -115,21 +115,20 @@
(defun kj/shell-here ()
(interactive)
- (shell (kj/shell-buffer-name)))
-
-(add-hook 'shell-mode-hook
- (defun kj/kill-shell-buffer-on-exit ()
- (let* ((proc (get-buffer-process (current-buffer)))
- (sentinel (process-sentinel proc)))
- (set-process-sentinel
- proc
- `(lambda (proc signal)
- (funcall ',sentinel proc signal)
- (and (memq (process-status proc) '(exit signal))
- (buffer-live-p (process-buffer proc))
- (message "Shell died, killing buffer %s"
- (process-buffer proc))
- (kill-buffer (process-buffer proc))))))))
+ (let ((buffer
+ (shell (kj/shell-buffer-name))))
+ (with-current-buffer buffer
+ (let* ((proc (get-buffer-process (current-buffer)))
+ (sentinel (process-sentinel proc)))
+ (set-process-sentinel
+ proc
+ `(lambda (proc signal)
+ (funcall ',sentinel proc signal)
+ (and (memq (process-status proc) '(exit signal))
+ (buffer-live-p (process-buffer proc))
+ (message "Shell died, killing buffer %s"
+ (process-buffer proc))
+ (kill-buffer (process-buffer proc)))))))))
(add-hook 'comint-output-filter-functions #'comint-osc-process-output)
@@ -212,7 +211,9 @@
(savehist-mode))
;; Rebind C-x?
-(define-key key-translation-map "\C-t" "\C-x")
+(global-set-key (kbd "C-t") 'ctrl-x-map)
+(define-key global-map (kbd "C-t") ctl-x-map)
+;; (define-key key-translation-map "\C-t" "\C-t")
;; (define-key key-translation-map "\C-x" "\C-t")
(use-package marginalia