diff options
Diffstat (limited to '.config/bash')
-rw-r--r-- | .config/bash/rc.d/90_emacs.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/.config/bash/rc.d/90_emacs.sh b/.config/bash/rc.d/90_emacs.sh index 595ddcf..79d5e61 100644 --- a/.config/bash/rc.d/90_emacs.sh +++ b/.config/bash/rc.d/90_emacs.sh @@ -36,12 +36,16 @@ if [[ $TERM == eterm* ]]; then # (default-directory) to an invalid TRAMP string. # # Because the hostname is compared to (system-name) to - # check if it is localhost, "$(hostname -f)" needs to - # be used instead of $HOSTNAME, unfortunately. + # check if it is localhost, "$(hostname -f)" may need + # to be used instead of $HOSTNAME, if + # $HOSTNAME/$(hostname) doesn't return a qualified + # domain. + local hostname=$HOSTNAME + [[ $hostname = *.* ]] || hostname="$(hostname -f)" printf '\eAnSiT%s %s\n' \ u "$USER" \ c "$PWD" \ - h "$(hostname -f)" + h "$hostname" } # Set the shell's X11 display (emacs -> shell) _emacs_set_shell_DISPLAY() { |