Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdio.prompt can crash PowerShell #249

Open
metatablecat opened this issue Aug 27, 2024 · 8 comments
Open

stdio.prompt can crash PowerShell #249

metatablecat opened this issue Aug 27, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@metatablecat
Copy link

metatablecat commented Aug 27, 2024

this may be a dupllicate of #241 but I'll provide some extra repro steps, it may take a few tries.

Run lune and type in these two lines:

stdio = require("@lune/stdio")
stdio.prompt("text", "hi")

Next, press Ctrl-C to exit out of the prompt prematurely. Press "up", and powershell will crash. I haven't been able to replicate this behaviour in cmd

@filiptibell filiptibell added the bug Something isn't working label Aug 27, 2024
@CompeyDev
Copy link
Contributor

image

I can't seem to replicate this. I've faced a similar issue on Linux where the cursor disappears on selection menus on exiting with a SIGINT, since the ANSI doesn't get reset, but that's a much smaller issue compared to an entire shell crash.

@metatablecat
Copy link
Author

metatablecat commented Aug 27, 2024

image

I can't seem to replicate this. I've faced a similar issue on Linux where the cursor disappears on selection menus on exiting with a SIGINT, since the ANSI doesn't get reset, but that's a much smaller issue compared to an entire shell crash.

Try it without putting anything in the input field.

@CompeyDev
Copy link
Contributor

I didn't put anything in the field though?

@metatablecat
Copy link
Author

metatablecat commented Aug 27, 2024

oops im dumb :3

uh yeah im not exactly sure how to repro it specifically, it doesn't always happen from what i've tested so it could be anything? I'll send a picture so it doesn't look like im crazy (im not crazy right?)

Regardless, here's proof of it crashing out of powershell in cmd
image

@CompeyDev
Copy link
Contributor

CompeyDev commented Aug 27, 2024

Odd, if you face this again, can you give the exit code of powershell? I believe you can get it by echoing %ERRORLEVEL% in command prompt after powershell exits (I'm not sure though).

@metatablecat
Copy link
Author

metatablecat commented Aug 27, 2024

image
/shrug

i can get more detailed info on it in event viewer but github wont allow EVTX

@Sythivo
Copy link

Sythivo commented Sep 20, 2024

This is most likely to due to the Console Mode changed while using stdio.prompt left in a state in which powershell does not like. Lune would have to restore the console mode back to original or default state.

@CompeyDev
Copy link
Contributor

This is most likely to due to the Console Mode changed while using stdio.prompt left in a state in which powershell does not like. Lune would have to restore the console mode back to original or default state.

Lune doesn't manually depend on the windows API, but rather uses a crate called console for abstracting around cross-platform terminals. If what you are saying is true, this should be taken up as an issue with the above crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants
@filiptibell @Sythivo @CompeyDev @metatablecat and others