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

Interactive inputs do not produce "echo" #566

Closed
sourishkrout opened this issue May 6, 2024 · 6 comments
Closed

Interactive inputs do not produce "echo" #566

sourishkrout opened this issue May 6, 2024 · 6 comments
Assignees
Labels
bug Something isn't working runnerv2

Comments

@sourishkrout
Copy link
Member

Simple example is running read. Unclear what needs to toggle whether or not echoing is enabled. Might have to do some digging in Runnerv1.

config:{program_name:"/bin/zsh" directory:"/Users/sourishkrout/Projects/stateful/oss/vscode-runme/examples" env:"RUNME_ID=01HX7QEZTB94V7A28K766WNRG3" env:"TERM=xterm-256color" commands:{items:"read" items:""} interactive:true mode:COMMAND_MODE_INLINE known_id:"01HX7QEZTB94V7A28K766WNRG3"} winsize:{rows:10 cols:177} session_id:"01HX7QGJ4VNB9YYEC3NCHD908M" store_stdout_in_env:true

if err := disableEcho(c.tty.Fd()); err != nil {
return err
}

@adambabik
Copy link
Collaborator

It's disabled by default:

if err := disableEcho(c.tty.Fd()); err != nil {
return err
}

Should it be enabled or configurable?

@sourishkrout
Copy link
Member Author

sourishkrout commented May 6, 2024

Should it be enabled or configurable?

I wish I could remember the logic because it wasn't just always on or always off. Do you see anything in the runnerv1 implementation that's revelatory?

@adambabik when you search for DisableEcho it appears that the echo is enabled when a TTY is attached which is always true for a VirtualCommand, no?

@sourishkrout sourishkrout added bug Something isn't working runnerv2 labels May 7, 2024
@adambabik
Copy link
Collaborator

I wish I could remember the logic because it wasn't just always on or always off. Do you see anything in the runnerv1 implementation that's revelatory?

In the runnerv1 service, echo is always enabled. When using the CLI, executing a program which is a file or shell, and the block is marked as interactive, which is a default, then echo is disabled. I am not sure if it was well thought out, but the fact is that in runnerv2 echo is always disabled. Should I flip it to stay compatible?

@adambabik when you search for DisableEcho it appears that the echo is enabled when a TTY is attached which is always true for a VirtualCommand, no?

This is true and VirtualCommand is used when the block is interactive, which is a default.

@sourishkrout
Copy link
Member Author

@sourishkrout yes, let's go ahead and flip it please. Being "incompatible" otherwise means the integration with the notebook terminal stops working as expected.

@adambabik
Copy link
Collaborator

@sourishkrout I merged #576. Let me know if there is anything else that should be done as a part of this ticket.

@sourishkrout
Copy link
Member Author

@sourishkrout I merged #576. Let me know if there is anything else that should be done as a part of this ticket.

This looks good now 👍 . Thank you!

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

No branches or pull requests

2 participants