From 7896c121d7937d50b4ff697761e8ffc7f34e0916 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 6 Dec 2013 14:09:15 +0900 Subject: [PATCH] fix terminal-title prefs --- emacs.el | 25 +++++++++++++++++++++---- shrc | 8 ++++---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/emacs.el b/emacs.el index b807a3a..3efe4b4 100644 --- a/emacs.el +++ b/emacs.el @@ -304,10 +304,27 @@ found, otherwise returns nil." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; title and mode-line -;; (when (fetch-library -;; "https://raw.github.com/10sr/emacs-lisp/master/terminal-title.el" -;; t) -;; (require 'terminal-title nil t)) +(when (fetch-library + "https://raw.github.com/10sr/emacs-lisp/master/terminal-title.el" + t) + (require 'terminal-title nil t) + ;; if TERM is not screen use default value + (when (equal (car (split-string (frame-parameter nil + 'tty-type) + "-")) + "screen") + (setq terminal-title-format + (if (getenv "SSH_CONNECTION") + '("em:" + user-login-name + "@" + system-name + ":" + (file-name-nondirectory (directory-file-name + default-directory))) + '((file-name-nondirectory (directory-file-name + default-directory)))))) + (terminal-title-mode)) (setq eol-mnemonic-dos "\\r\\n") (setq eol-mnemonic-mac "\\r") diff --git a/shrc b/shrc index 5ea9173..00c019d 100755 --- a/shrc +++ b/shrc @@ -551,10 +551,10 @@ datestr(){ date +"$dfmt" } -ssh(){ - __my_set_screen_title ssh - command ssh "$@" -} +# ssh(){ +# # __my_terminal_title ssh +# command ssh "$@" +# } __ssh_with_cd(){ # __ssh_with_cd [ ...]