|
2004-09-21
| ||
| 23:46 | • Ticket [1031860fff] Cannot set prompt status still Closed with 2 other chang... artifact: dcd2a23b22 user: dgp | |
| 23:46 | • Ticket [1031860fff]: 7 changes artifact: 776b3a96cf user: dgp | |
| 23:46 | • Closed ticket [1031860fff]. artifact: dde24002ee user: dgp | |
| 20:01 | • Ticket [1031860fff]: 2 changes artifact: 782cb543a2 user: dkf | |
| 12:49 | • New ticket [1031860fff]. artifact: f984a6a3e4 user: nobody | |
Cannot set prompt
Closed / Invalid1031860fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-09-21 12:49:21
Setting the tcl_prompt1 and tcl_prompt2 values such
that the expression executes without errors results in no
prompt showing at all.
In tclsh (or any application linked to the Tcl library) try
typing;
set tcl_prompt1 { return -code error Hello }
This will print "Hello" on one line followed by the default
prompt (read the code to see why).
typing;
set tcl_prompt1 { format "Hello" }
results in no prompt being printed.
The code is in the function Prompt() in tclMain.c.
If you add the code below at line 720 of tclMain.c then
everything works as I would expect it to.
} else {
outChannel = Tcl_GetStdChannel
(TCL_STDOUT);
if (outChannel != (Tcl_Channel) NULL)
{
Tcl_WriteObj(outChannel,
Tcl_GetObjResult(interp));
}
}
If you have any questions, email me at
[email protected]
dkf Ticket [1031860fff]: 2 changes
[History diff]2004-09-21 20:01:23
dgp Closed ticket [1031860fff].
[History diff]2004-09-21 23:46:00
dgpplain2004-09-21 23:46:01
Logged In: YES
user_id=80530
Submitter needs to re-read
the tclsh.1 documentation
http://tmml.sourceforge.net/doc/tcl/tclsh.html
It is expected that the values of
::tcl_prompt1 and ::tcl_prompt2,
if any, are scripts that do their own
writing to stdout. For example,
set ::tcl_prompt1 {puts -nonewline stdout "Hello "}
I agree with the submitter that
his alternative interface (return the
prompt value for the core to write)
is superior, but that's not the one that
was chosen all those years ago.
Proposal for alternative means to
customize the prompts should be
filed as a feature request.
dgp Ticket [1031860fff]: 2 changes
[History diff]2004-09-21 23:46:02
Log in (anonymous is fine) to add a comment.