Skip to content
Tcl Source Code History Of Ticket 1556342
Login

History Of Ticket 1556342

Artifacts Associated With Ticket 1556342

  1. Ticket change [fd1e5b5c15] (rid 108358) by nobody on 2006-09-11 13:06:36:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "nobody"
    10. subsystem initialized to: "20. [interp]"
    11. title initialized to: "set stdin/stdout/stderr with interp transfer/share"
    12. type initialized to: "RFE"
  2. Ticket change [0626a959e6] (rid 89170) by dgp on 2006-09-11 22:53:25:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Just a quick comment to note
      that currently Tcl forces
      one shared set of std
      channels for all interps in
      the same thread.  From a
      quick read, it seems what's
      sought here is a pretty fundamental
      re-thinking of that.  It's not
      just a matter of providing
      some better commands to more
      easily access something we can
      do now.  It's a request to make
      possible something that's not
      possible at all currently.
      
      We've only fairly recently
      moved from the "entire app
      uses the same std channels"
      model to "each thread has
      a set of std channels" model.
      
      All of this may be obvious
      to the anonymous submitter,
      but worth noting here for
      others reading.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [0e9d185e88] (rid 94647) by nobody on 2006-09-13 08:08:32:

    1. icomment:
      Logged In: NO 
      
      Actually, I didn't realize quite how bad it was, I should have figured it out, 
      though, since the Get/SetStdChannel routines don't take an interpreter 
      argument.  I didn't realize it was as bad as having the GetChannelNames and 
      GetChannel calls actually hardcoding in the stdin/out/err names, though.
      
      What's needed is to get away from the idea that the "channel name" is fixed 
      and immutable and is what should be registered in the channel name hash 
      table in each interpreter.  Leaving the current RegisterChannel to pick the 
      name out of the channel, and adding a new one to allow registering it under a 
      supplied name, as well as requiring a name to unregister it, would seem to 
      me to be mostly all that would be needed.  Fix the few places that unregister 
      a channel (i.e. close) to supply the channel name instead of having it be 
      implicit, and you're done.
      
      Get/SetStdChannel would still supply the defaults for a new interpreter, but 
      wouldn't have the weird effects it now has if there is a slave interpreter 
      already initialized when you change the standard channels and it doesn't have 
      the "real" new channel already registered.
      
      [email protected]
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"