diff options
author | Kevin Walzer <kw@codebykevin.com> | 2020-09-19 17:31:00 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2020-09-19 17:31:00 (GMT) |
commit | 886d0a169c21734e775e8d85abd92a744157c368 (patch) | |
tree | 3e828cfcde02c7bb6f5f787fc53bf6d26d0a5b70 | |
parent | 9a88b659032a19a16dc63d641906ca9c45ff82d9 (diff) | |
download | tk-886d0a169c21734e775e8d85abd92a744157c368.zip tk-886d0a169c21734e775e8d85abd92a744157c368.tar.gz tk-886d0a169c21734e775e8d85abd92a744157c368.tar.bz2 |
Restore console
-rw-r--r-- | macosx/tkMacOSXInit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 2601d6b..2fbfd4d 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -381,8 +381,9 @@ TkpInit( * clicking Wish) then use the Tk based console interpreter. */ - if (!isatty(0) && (fstat(0, &st) || (S_ISCHR(st.st_mode) && st.st_blocks == 0))) { - if (getenv("TK_CONSOLE")) { + if (getenv("TK_CONSOLE") || + (!isatty(0) && (fstat(0, &st) || + (S_ISCHR(st.st_mode) && st.st_blocks == 0)))) { Tk_InitConsoleChannels(interp); Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDIN)); Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDOUT)); @@ -400,11 +401,11 @@ TkpInit( if (intvar == NULL) { Tcl_SetVar2(interp, "tcl_interactive", NULL, "1", TCL_GLOBAL_ONLY); + NSLog(@"tcl_interactive"); } } if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) { return TCL_ERROR; - } } else { /* |