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

REPL : Incomprehensible behavior with os.input () #5678

Closed
baxiry opened this issue Jul 5, 2020 · 2 comments · Fixed by #21811
Closed

REPL : Incomprehensible behavior with os.input () #5678

baxiry opened this issue Jul 5, 2020 · 2 comments · Fixed by #21811
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor.

Comments

@baxiry
Copy link

baxiry commented Jul 5, 2020

V version:
0.1.28 0fb28eb

OS:
linux

What did you do?
Set a variable with os.input in REPL

What did you expect to see?
Get the variable

What did you see instead?
Strange behavior. I cannot assign a value to a variable or enter anything.

@baxiry baxiry added the Bug This tag is applied to issues which reports bugs. label Jul 5, 2020
@JalonSolov
Copy link
Contributor

JalonSolov commented Jul 5, 2020

There are definitely issues using os.input() in REPL. For one, it is not flushing the output before trying to get the input. For another, it appears to be setting the variable to the prompt, rather than the input.

jalon@Ripper:~/git/v$ v
For usage information, quit V REPL using `exit` and use `v help`
V 0.1.28 271786b
Use Ctrl-C or `exit` to exit
>>> s := os.input('?: ')
asdf
?:
>>> s

?:
>>>

@JalonSolov JalonSolov added the Status: Confirmed This bug has been confirmed to be valid by a contributor. label Jul 5, 2020
@ArtemkaKun
Copy link
Contributor

Seems this is only a problem when creating a variable. Next calls of variable works as expected

>>> s := os.input('?: ')
asdf
?:
>>> s
asdf
?: asdf
>>> s
ggrr
?: ggrr
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants