Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fd1e5b5c15de97070bc434ad66b010d9408a83fc
Ticket: 1556342fffffffffffffffffffffffffffffffff
set stdin/stdout/stderr with interp transfer/share
User & Date: nobody on 2006-09-11 13:06:36
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The methods for setting stdin/stdout/stderr are pretty clunky, 
    especially from the script level.  It also doesn't seem to work well when 
    trying to set a slave interpreter to have stdin/stdout/stderr be 
    something different from the master interpreter.
    
    I suggest an optional additional argument on the transfer/share 
    subcommands of the interp command:
    
    interp share srcPath channelId destPath ?channelName? 
    
    e.g.
    
    interp transfer {} [open /dev/tty] $interp stdin
    
    or something like that (where channelName could be restricted to only 
    be stdin/stdout/sterr, or could be more general to have other "named" 
    channels, which would be interesting in and of itself).
    
    Alternatively, I was thinking maybe this should go on the new chan 
    command, perhaps something like:
    
    chan set channelName channelId
    
    e.g.
    
    chan set stdin [open /dev/tty]
    
    If that was available, then it could still be done a bit messily without a 
    change to interp:
    
    set handle [open /dev/tty]
    interp transfer {} $handle $interp
    interp eval $interp chan set stdin $handle
    
    The above should hide the file5 (or whatever) channel ID from the list 
    of open channels ([file channels] or [chan names]), just as a fresh 
    interpreter would when it initialized stdin/stdout/stderr, which is why 
    it might be better to have this on the interp command in the first place.
    
    Perhaps both are appropriate, however.
    
    Note that having this would make most or even all of the tkConsole.c 
    code unnecessary, as it could all be done with scripts and the new chan 
    command's ability to create a procedural channel.
    
    [email protected]
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "nobody"
  10. subsystem changed to: "20. [interp]"
  11. title changed to: "set stdin/stdout/stderr with interp transfer/share"
  12. type changed to: "RFE"