From cbcddccb5007f5e88baa56e5ce9da60d63eef2b1 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 29 Oct 2019 16:39:35 +0100 Subject: [PATCH] [FIX] Only source terminal prompt file if there I don't want to see an error message when ssh-ing to a computer which doesn't have this file because `termite` isn't installed. --- bash/.bashrc | 7 ++++--- zsh/.zshrc | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index 1aefb00..54da571 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -6,9 +6,10 @@ [[ $- != *i* ]] && return # Export our directory to Termite for opening new terminals -if [[ "$TERM" == xterm-termite ]] || [[ "$TERM" == xterm ]]; then - . /etc/profile.d/vte.sh - __vte_prompt_command +if { [[ "$TERM" == xterm-termite ]] || [[ "$TERM" == xterm ]]; } && + [ -r /etc/profile.d/vte.sh ]; then + . /etc/profile.d/vte.sh + __vte_prompt_command fi # Make colorcoding available for everyone diff --git a/zsh/.zshrc b/zsh/.zshrc index 217ee18..7453657 100755 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,8 +1,9 @@ # Export our directory to Termite for opening new terminals -if [[ "$TERM" == xterm-termite ]] || [[ "$TERM" == xterm ]]; then - . /etc/profile.d/vte.sh - __vte_osc7 - precmd_functions+=(__vte_prompt_command) # FIXME: why isn't it set above ? +if { [[ "$TERM" == xterm-termite ]] || [[ "$TERM" == xterm ]]; } && + [ -r /etc/profile.d/vte.sh ]; then + . /etc/profile.d/vte.sh + __vte_osc7 + precmd_functions+=(__vte_prompt_command) # FIXME: why isn't it set above ? fi # History configuration