Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

encoding null returns Buffer on linux but string on windows!

Open
#489 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js, typescript

Research direction

Reproduce the shown pty.spawn example with encoding:null using bash -i and cmd.exe, then inspect the mypty.on('data') entry point and how each platform delivers its payload. Done means the encoding:null behavior is consistent across both platforms, with the expected Buffer type verified on Linux and Windows.

Written by the indexing model from the issue text.

Description

bug windows

                    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!

Dominant language
TypeScript
Stars
2k
Forks
337
Avg merge
21h 58m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/node-pty

All issues in microsoft/node-pty

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.