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

encoding null returns Buffer on linux but string on windows! #489

Open
Zibri opened this issue Aug 14, 2021 · 1 comment
Open

encoding null returns Buffer on linux but string on windows! #489

Zibri opened this issue Aug 14, 2021 · 1 comment
Labels
bug Issue identified by VS Code Team member as probable bug windows

Comments

@Zibri
Copy link

Zibri commented Aug 14, 2021


                    if (typeof process.env.ComSpec == "undefined") {
                        cmd = "bash";
                        cmdargs = ["-i"]
                    } else {
                        cmd = "cmd.exe";
                        cmdargs = []
                    }


mypty = pty.spawn( cmd, cmdargs, {
                    name: 'xterm-256color',
                    cols: 80,
                    rows: 25,
                    env: process.env,
                    encoding: null
                });

if cmd and cmdargs is bash -i, with encoding:null mypty.on("data") returns a Buffer as it should.
but if running on windows and cmd and cmdargs are CMD.EXE then mypty.on("data") returns a STRING!

@Tyriar
Copy link
Member

Tyriar commented Aug 16, 2021

Right now we have this as a warning:

if (opt.encoding) {
console.warn('Setting encoding on Windows is not supported');
}

Though it won't show up if you pass in null, we should fix that and also update the .d.ts to explain.

@Tyriar Tyriar added this to the 1.0.0 milestone Aug 16, 2021
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug windows labels Aug 16, 2021
@Tyriar Tyriar removed this from the 1.0.0 milestone Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug windows
Projects
None yet
Development

No branches or pull requests

2 participants