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

OSC sequences flushed asynchronously #752

Open
cpendery opened this issue Dec 31, 2024 · 0 comments
Open

OSC sequences flushed asynchronously #752

cpendery opened this issue Dec 31, 2024 · 0 comments

Comments

@cpendery
Copy link
Member

I thought enabling the new useConptyDll feature in node-pty@1.1.0-beta27 would cause all OSC sequences to be synchronously emitted, but I'm still seeing them get emitted before the content they surround. Is there another setting I need to enable for this behavior?

Example:

var os = require("os");
var fs = require("fs");
var pty = require("node-pty");

var shell = os.platform() === "win32" ? "pwsh.exe" : "bash";

var ptyProcess = pty.spawn(shell, [], {
  name: "xterm-color",
  cols: 80,
  rows: 30,
  cwd: process.env.HOME,
  env: process.env,
  useConpty: true,
  useConptyDll: true,
});

ptyProcess.onData((data) => {
  fs.appendFileSync("output.txt", data + "\n");
});

ptyProcess.write('echo "$([char]0x1b)]6973;START`a12$([char]0x1b)]6973;END`a"\r');

Output:

�[?25l
�[93mecho �[36m"�[37m$([char]�[97m0x1b�[37m)�[36m]6973;START`a12�[37m$([char]�[97m0x1b�[37m)�[36m]6973;END`a"
�[?25h
�]6973;START��]6973;END�
�[m12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant