Browse Source

Add __isatty internal variable

git-svn-id: https://klish.googlecode.com/svn/trunk@546 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
a65e38e422
1 changed files with 5 additions and 0 deletions
  1. 5 0
      clish/shell/shell_var.c

+ 5 - 0
clish/shell/shell_var.c

@@ -90,6 +90,11 @@ static char *find_context_var(const char *name, clish_context_t *this)
 			result = strdup("1");
 		else
 			result = strdup("0");
+	} else if (!lub_string_nocasecmp(name, "_isatty")) {
+		if (tinyrl__get_isatty(this->shell->tinyrl))
+			result = strdup("1");
+		else
+			result = strdup("0");
 	} else if (lub_string_nocasestr(name, "_prefix") == name) {
 		int idx = 0;
 		int pnum = 0;