oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.71k stars 2.72k forks source link

node-compat: process.argv0 #6696

Open chibat opened 11 months ago

chibat commented 11 months ago

What version of Bun is running?

1.0.7

What platform is your computer?

Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

$ bash -c 'exec -a customArgv0 bun repl'
Welcome to Bun v1.0.7
Type ".help" for more information.
[!] Please note that the REPL implementation is still experimental!
    Don't consider it to be representative of the stability or behavior of Bun overall.
> process.argv0
'bun'

What is the expected behavior?

$ bash -c 'exec -a customArgv0 bun repl'
> process.argv0
'customArgv0'

Node.js

$ bash -c 'exec -a customArgv0 node'
Welcome to Node.js v20.1.0.
Type ".help" for more information.
> process.argv0
'customArgv0'

The result when explicitly specifying the process name is different from Node.js.

What do you see instead?

No response

Additional information

No response

nektro commented 4 months ago

this is a side effect of the way the repl is currently setup but the issue does not persist in direct bun processes

❯ bash -c 'exec -a customArgv0 bun --print "process.argv0"'
customArgv0