Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7daaee474b2a0af1dc30b3cf46665e60842cfc8a675f4291a19893d6af49f688
Ticket: 469618ffffffffffffffffffffffffffffffffff
using [exec] for WinGUI apps is invalid.
User & Date: apnadkarni on 2026-04-24 06:34:25
Changes

  1. assignee changed to: "aku"
  2. closedate changed to: "2461154.773908102"
  3. closer changed to: "apnadkarni"
  4. comment changed to:
    Windows GUI applications are detached from a console 
    and do not support pipes.  [exec] should know this.
    
    Here's what I added:
    C:\WINNT\system32>tclsh84
    % exec notepad
    C:\WINNT\system32\notepad.exe is a GUI application 
    that doesn't support pipes: broken pipe
    % puts $errorCode
    POSIX EPIPE {broken pipe}
    %
    
    I feel the errorCode is conceptually correct.  I also 
    added deeper checks into the PE header of the file for 
    checking if the file truly is executable.  I also 
    added a check for the .cmd extension which is 
    analogous to .bat
    
    The best way to launch GUI applications is with 
    ShellExecute() rather than CreateProcess().  [exec] 
    can not support pipes to GUI applications and i feel 
    it should be disabled.  This would of course need a 
    new command for launching GUI apps...
    
  5. icomment:
    Obsolete. Not an issue in 8.6/9. (Cleaning up exec/auto_execok bugs).
    
  6. login: "apnadkarni"
  7. mimetype: "text/plain"
  8. resolution changed to: "Fixed"
  9. severity changed to: "Minor"
  10. status changed to: "Closed"