Skip to content

ReferenceError: Can't find variable: RegExpPrototypeExec, require('tty').WriteStream.prototype.getColorDepth() #5465

Closed

Description

What version of Bun is running?

1.0.1

What platform is your computer?

Darwin 21.6.0 x86_64 i386

What steps can reproduce the bug?

image

executed in macOS iTerm2, and process.env.TERM => 'xterm-256color'

  1. bunx bun-repl
  2. exec var t = require('tty')
  3. exec t.WriteStream.prototype.getColorDepth()

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

this method is used in the npm module clipanion

function getDefaultColorDepth() {
--
12 | if (tty__default['default'] && `getColorDepth` in tty__default['default'].WriteStream.prototype)
13 | return tty__default['default'].WriteStream.prototype.getColorDepth();
14 | if (process.env.FORCE_COLOR === `0`)
15 | return 1;
16 | if (process.env.FORCE_COLOR === `1`)
17 | return 8;
18 | if (typeof process.stdout !== `undefined` && process.stdout.isTTY)
19 | return 8;
20 | return 1;
21 | }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions