Re: [Moand] MSH Crashes when changing prompt
Indeed. This is a bug. It appears that the shell is crashing if the prompt
function returns null.
Here is another simple repro:
MSH>function prompt { return $null }
I've opened a bug for this.
In your case, the function is returning null because there isn't an
environment variable called 'username:'. You could use this instead:
function prompt { "${env:username}:" }
Thanks!
--
Marcel Ortiz [MSFT]
Monad: Microsoft Command Shell
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Umesh Thakur" <UmeshThakur@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:005E77B6-8ACF-4B0B-BDFC-E7F5A1759362@xxxxxxxxxxxxxxxx
> Hi,
>
> When changing prompt using following function, it works:
>
> function prompt { "$env:username:" }
> OR
> function prompt { $env:username + ":"}
>
> prompt is changed to (if logged-on user name is "Umesh"):
> Umesh:
>
> However, if following functions is used, to do the same, MSH crashes:
>
> function prompt { $env:username: }
>
> following message is displayed:
> msh.exe has encountered a problem and needs to close. We are sorry for
> the
> inconvenience.
>
> A possible bug?
>
>
> --
> Umesh
.
Relevant Pages
- RE: Bug or Not? Cmd Prompt/Switching Issue
... Yes, if you can be more specific (which programs, examples, etc, what command ... When my PC is in a full screen program, I minimized it, which after i open ... prompt will open for a split second which minimizes the full screen program, ... A bug is a defect in the software code which doesn’t allow the software to ... (microsoft.public.windows.vista.general) - New Bug: Word 2007: Can result in deletion of template files
... We're calling it the "Double Save Prompt" bug. ... It destroys template documents in a non-retrievable fashion. ... I went through the document and applied the new quickstyle sheets to the ... (microsoft.public.word.application.errors) - Re: Styles in Word 2007
... when you started Word using the /a switch and then selected the Prompt to ... Update Style option. ... and if it's enabled you'll encounter the bug. ... I usually keep Prompt to Update turned off. ... (microsoft.public.word.docmanagement) - Re: New Bug: Word 2007: Can result in deletion of template files
... If you recreate the bug and save a file at the first prompt, ... (microsoft.public.word.application.errors) - Re: New Bug: Word 2007: Can result in deletion of template files
... Did not receive a 2nd prompt to save a file. ... If you recreate the bug and save a file at the first prompt, ... (microsoft.public.word.application.errors) |
|