From be5dcb8a59c795495318522522b92672886d4a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 9 Aug 2015 21:55:10 +0200 Subject: [PATCH 1/2] Check if fbterm is installed and use $TTY variable --- plugins/fbterm/fbterm.plugin.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/fbterm/fbterm.plugin.zsh b/plugins/fbterm/fbterm.plugin.zsh index 4f0456016..d60f0e27d 100644 --- a/plugins/fbterm/fbterm.plugin.zsh +++ b/plugins/fbterm/fbterm.plugin.zsh @@ -1,6 +1,8 @@ # start fbterm automatically in /dev/tty* -if [[ $(tty|grep -o '/dev/tty') = /dev/tty ]] ; then - fbterm - exit +if (( ${+commands[fbterm]} )); then + if [[ "$TTY" = /dev/tty* ]] ; then + fbterm + exit + fi fi From be10229659959a4ff455642e44fdaa5666e15ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 9 Aug 2015 21:56:02 +0200 Subject: [PATCH 2/2] Exit only if the fbterm session closed correctly This prevents the previous behavior that exitted the zsh session even if fbterm didn't start correctly. --- plugins/fbterm/fbterm.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/fbterm/fbterm.plugin.zsh b/plugins/fbterm/fbterm.plugin.zsh index d60f0e27d..bc2532092 100644 --- a/plugins/fbterm/fbterm.plugin.zsh +++ b/plugins/fbterm/fbterm.plugin.zsh @@ -2,7 +2,6 @@ if (( ${+commands[fbterm]} )); then if [[ "$TTY" = /dev/tty* ]] ; then - fbterm - exit + fbterm && exit fi fi