Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a7f5e1bfb27c04f5bab5d81a13a9eeb97b48929e
Ticket: 218019ffffffffffffffffffffffffffffffffff
Need to force Tcl prompt even if not run from a tty.
User & Date: nobody on 2000-10-26 00:52:15
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1127 RFE
    Version: 8.0.4
    SubmitDate: '1999-01-29'
    LastModified: '2000-05-10'
    Severity: MED
    Status: Closed
    Submitter: welch
    ChangedBy: hobbs
    OS: Solaris
    OSVersion: 5.6
    Machine: Other
    FixedDate: '2000-10-25'
    ClosedDate: '2000-05-10'
    
    
    Name:
    
    Krzysztof Kozminski
    
    
    Extensions:
    
    Too many to list
    
    
    DesiredBehavior:
    
    I need to force Tcl to believe that it is being run interactively, even though it is really being run from a pipe spawned by another program.  This other program (a product of a major CAD software vendor) has really clunky communication facility (no scriptable sockets, just pipes), and the Tcl prompt is the easiest way to let the other program know that my interpreter is ready to accept commands.
    
    
    Patch:
    
    diff --ignore-matching-lines=$Id: --ignore-matching-lines=$Source: --ignore-matching-lines=$Header: --ignore-matching-lines=$Date: --ignore-matching-lines=$Author: --ignore-matching-lines=$Revision: -c -r1.1 proWrapTclMain.c
    
    *** proWrapTclMain.c    1999/01/26 07:22:53 1.1
    
    --- proWrapTclMain.c    1999/01/26 07:29:24
    
    ***************
    
    *** 196,201 ****
    
    --- 196,203 ----
    
        Tcl_DeleteInterp(interp);
    
        Tcl_Exit(1);
    
          }
    
    + 
    
    +     tty = strcmp(Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY), "0");
    
    
          /*
    
           * If a script file was specified then just source that file
    
    diff --ignore-matching-lines=$Id: --ignore-matching-lines=$Source: --ignore-matching-lines=$Header: --ignore-matching-lines=$Date: --ignore-matching-lines=$Author: --ignore-matching-lines=$Revision: -c -r1.1 proWrapTkMain.c
    
    *** proWrapTkMain.c 1999/01/25 21:23:44 1.1
    
    --- proWrapTkMain.c 1999/01/26 21:07:40
    
    ***************
    
    *** 210,218 ****
    
    --- 210,221 ----
    
    
          if ((*appInitProc)(interp) != TCL_OK) {
    
        TkpDisplayWarning(interp->result, "Application initialization failed");
    
    +   Tcl_Eval(interp, "puts stderr $errorInfo");
    
        Tcl_DeleteInterp(interp);
    
        Tcl_Exit(1);
    
          }
    
    + 
    
    +     tty = strcmp(Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY), "0");
    
    
          /*
    
           * Invoke the script specified on the command line, if any.
    
    
    PatchFiles:
    
    proWrapTclMain.c
    
    proWrapTkMain.c
    
    
    
    
    All that this patch does is to enable user's appInitProc to reset the tcl_interactive variable to 1.
    
    Seems to work, although I was not at all sure whether changing this variable after Pro_WrapInit(interp) was a healthy idea.
    
    --
    All this can be done at the tcl level by setting tcl_interactive
    and creating a simulated event loop handling. 
    -- 05/10/2000 hobbs
    
    
    
  4. foundin changed to: "obsolete: 8.0.4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    Need to force Tcl prompt even if not run from a tty.
    
  11. type changed to: "Bug"