Problem description:
Printing the Replit symbol used by default in the console (
) causes the editor to think the program has stopped
Expected behavior:
The editor knows the program is still running
Actual behavior:
The editor thinks the program has stopped
Steps to reproduce:
Option 1:
Print/display
to the console
observe the Stop
button change to Run
even though the program is still running
Option 2:
Use this repl.
Observe that the editor assumes the program has stopped, while the program is still running.
Bug appears at this link:
https://replit.com/@Firepup650/day23100-days#main.py
Browser/OS/Device:
Chrome 108.0.5359.230 (Official Build) (64-bit)/Chrome OS 15183.93.0 (Official Build) stable-channel octopus/Chromebook
Notes:
I know
isn’t displayed properly here, it will display correctly when printed to the console.
This only works in interpreted languages I believe.
This seems to be a side effect of the way replit checks for a stopped program (checks the prompt), surely there’s a better way to check.
1 Like
9pfs1
May 15, 2023, 4:04pm
2
I can’t reproduce the bug on a test repl, does it need to use python?
I’m not sure, try setting the color as well, maybe that affects it.
Color: \033[38;2;161;138;26m
Minimal echo
: echo -e "\033[38;2;161;138;26m "
1 Like
It’s not a bug, it is a font implementation that is required for the console.
9pfs1
May 15, 2023, 7:26pm
5
I think @Firepup650 is saying that replit incorrectly assumes that the program has exited, even when it hasn’t.
1 Like
I went to your Repl and saw this , dunno why it would be a feature to stop the Repl when it sees this character, but maybe it is
That is exactly what I was talking about, glad it’s able to be reproduced on the cover page!
This is just how the console interpreter works, you can change the prompt in .replit https://docs.replit.com/programming-ide/configuring-repl#prompt
Let me clarify, it’s not that I dislike the prompt, it’s that Replit should not assume the program has stopped just because it sees the symbol.
That setting doesn’t change the prompt being used, it changes what replit looks for to detect that the program ended, if you changed that setting to the letter a the replit will stop “running” when it sees the letter a
Pretty sure it does this because it wouldn’t know if it’s currently running a repl or the actual program, but i’m not sure what you mean by it does change the prompt cause for me it says “A list of bytes used to detect running state, if unspecified it defaults to [0xEE, 0xA7]
.”
Surely there’s a better way to check this.
Change the prompt, and then check the console (might need to kill 1
in the shell first). I’m almost certain it will change.
I definitely agree, like two days ago I spent way too long trying to setup a custom interpreter trying to figure out why it would never stop running then I found I had to change a really badly named prompt setting
Tried it, nothing happened even when using prybar specifically the python one
Did you set it to a byte array or a string?
I set it to a byte array of [0x61]
It must be set above the [interpreter.command]
line
You also have to modify prybar’s prompt.
Minimal working example for prybar
:
[interpreter]
prompt = [0x54, 0x65, 0x73, 0x74, 0x20]
[interpreter.command]
args = [
"stderred",
"--",
"prybar-python3",
"-q",
"--ps1",
"Test ",
"-i",
]
env = { LD_LIBRARY_PATH = "$PYTHON_LD_LIBRARY_PATH" }
Oh, I thought you meant that changing the prompt setting would change the prompt all on its own without also having to edit the ps1 flag
I thought it would, but upon experimentation it did not. IMO, it should.
I have exploited this before to make a command-line prompt that actually looked like the program stopped.