summaryrefslogtreecommitdiff
path: root/plugins/fbterm
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/fbterm')
-rw-r--r--plugins/fbterm/README.md9
-rw-r--r--plugins/fbterm/fbterm.plugin.zsh7
2 files changed, 13 insertions, 3 deletions
diff --git a/plugins/fbterm/README.md b/plugins/fbterm/README.md
new file mode 100644
index 000000000..eec33d7ee
--- /dev/null
+++ b/plugins/fbterm/README.md
@@ -0,0 +1,9 @@
+# fbterm
+
+This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm)
+if on a real TTY (`/dev/tty*`).
+
+To use it, add fbterm to the plugins array of your zshrc file:
+```
+plugins=(... fbterm)
+```
diff --git a/plugins/fbterm/fbterm.plugin.zsh b/plugins/fbterm/fbterm.plugin.zsh
index 4f0456016..bc2532092 100644
--- a/plugins/fbterm/fbterm.plugin.zsh
+++ b/plugins/fbterm/fbterm.plugin.zsh
@@ -1,6 +1,7 @@
# 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