Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help on changing tcl prompt

323 views
Skip to first unread message

lihong pei

unread,
Apr 13, 2005, 1:40:08 PM4/13/05
to
Hi,
I'm not so familiar with Tcl. I would like to get some help regarding
changing tcl prompt.
From the online document, "tcl_prompt1" variable must be set and
associated with a tcl script to output a prompt.
However, I could not make it work.
If you have any experience of changing the prompt, could you help to
give some hint?

Thanks a lot in advance!

Lihong

Don Porter

unread,
Apr 13, 2005, 2:39:07 PM4/13/05
to
lihong pei wrote:
> If you have any experience of changing the prompt, could you help to
> give some hint?

set tcl_prompt1 {puts -nonewline stdout {my fancy new prompt> }}

--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Shaun Deacon

unread,
Apr 13, 2005, 4:17:12 PM4/13/05
to

Just in case Don's advice doesn't work for you...

If you are changing the prompt within a procedure you
must also be aware that 'tcl_prompt1' is in the global
namespace, so the following will be required :

proc foo {} {
global tcl_prompt1
set tcl_prompt1 {puts -nonewline stdout "myprompt>"}
}

or

proc foo {} {
set ::tcl_prompt1 {puts -nonewline stdout "myprompt>"}
}

cheers,
Shaun

0 new messages