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

write to process without echo-ing the message #180

Closed
dusadrian opened this issue Apr 3, 2018 · 2 comments
Closed

write to process without echo-ing the message #180

dusadrian opened this issue Apr 3, 2018 · 2 comments
Labels

Comments

@dusadrian
Copy link

dusadrian commented Apr 3, 2018

Hello, newbie here.
Would it be possible to send a message (command) to a process, but without displaying that command in the terminal (such as xterm.js)?

Ideally, it should also receive a response.

It should not be write (which echoes in the terminal), but presumably something else. Something in the direction of:
console.log(ptyProcess.write('ls\r'));

(thus receiving the result in the Javascript caller)
Thanks in advance.

@Tyriar
Copy link
Member

Tyriar commented Apr 3, 2018

Other than something like this, the only way to do something like this is to intercept the data stream and remove characters from it before it gets to your terminal.

@Tyriar Tyriar closed this as completed Apr 3, 2018
@Tyriar Tyriar added the question label Apr 3, 2018
@dusadrian
Copy link
Author

dusadrian commented Apr 3, 2018

Thanks very much, this helps a lot.
The way to intercept the data stream resides in the renderer.js file, in this call:

ptyProcess.on('data', function (data) {
  xterm.write(data);
});

Awesome.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants