Browse Source

Interactive mode can't be 1 when isatty is 0

Serj Kalichev 7 years ago
parent
commit
8aaddba3b3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      clish/shell/shell_var.c

+ 2 - 1
clish/shell/shell_var.c

@@ -100,7 +100,8 @@ static char *find_context_var(const char *name, clish_context_t *this)
 			result = clish_shell__get_params(this);
 
 	} else if (!lub_string_nocasecmp(name, "_interactive")) {
-		if (clish_shell__get_interactive(this->shell))
+		if (clish_shell__get_interactive(this->shell) &&
+			tinyrl__get_isatty(this->shell->tinyrl))
 			result = strdup("1");
 		else
 			result = strdup("0");