Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!pawl.rpi.edu!deven From: deven@pawl.rpi.edu (Deven Corzine) Newsgroups: comp.windows.news Subject: Re: Sun Terminal & Executive Prompt. Message-ID: Date: 21 Feb 89 03:13:43 GMT References: <21145.8902131122@isgcl.cs.reading.ac.uk> Sender: usenet@rpi.edu Organization: RPI Public Access Workstation Lab, Troy, NY Lines: 65 In-reply-to: Anthony.D.Worrall@reading.ac.UK's message of 13 Feb 89 20:44:19 GMT In article <21145.8902131122@isgcl.cs.reading.ac.uk> Anthony.D.Worrall@reading.ac.UK writes: > Is it possible to set a prompt in the psh executive mode? Laser writers >use a prompt and it makes things so much more user friendly. Yes, indeed. This is one of the many changes I have in my user.ps. There is a slight bug in the input handling that will cause problems if you try to type a literal string with a newline in it. In other words: PS> (this is PS> a string) will not work correctly. (it will put (this is) on the stack and try to execute "a", "string", and ")"...) Aside from that, there is no limit to input line length. Here is the relevant code from my user.ps: -------------------------------------------------------------------------- systemdict /prompt {(PS> ) print flush} put systemdict /executive { % - => - (Execute current file) countdictstack 1 eq {100 dict begin} if % make sure there is a userdict (Welcome to NeWS Version ) print version print (\n) print /execfile currentfile dup null eq {pop (%stdin) (r) file} if def { { execfile status not { quit } if { { prompt () { execfile 256 string readline pop dup length 256 eq not {append exit} if append } loop % get a line of input, without size restrictions cvx exec } loop } stopped pop execfile status not { quit } if ExecutiveErrorHandler } loop } stopped { quit } if } put -------------------------------------------------------------------------- As in the Adobe implementation, you can change the prompt globally with: systemdict /prompt {(NeWS> ) print flush} put to change the default prompt to "NeWS> " or you could use: /prompt {(NeWS> ) print flush} def to change it locally, for a single psh. The whole setup works rather nicely. I gave this change along with some others to gregm@sun.com a while back; maybe it will make it into a later release. I have yet to get around to fixing the string problem, but aside from that, it seems ok. Try it, you'll like it. :-) Deven -- ------- shadow@pawl.rpi.edu ------- Deven Thomas Corzine --------------------- Cogito shadow@acm.rpi.edu 2346 15th Street Pi-Rho America ergo userfxb6@rpitsmts.bitnet Troy, NY 12180-2306 (518) 272-5847 sum... In the immortal words of Socrates: "I drank what?" ...I think.