소스 검색

Add __isatty internal variable

git-svn-id: https://klish.googlecode.com/svn/trunk@546 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 년 전
부모
커밋
a65e38e422
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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;