bun icon indicating copy to clipboard operation
bun copied to clipboard

bun shell does not support Chinese paths

Open lvzhenbo opened this issue 3 months ago • 4 comments

What version of Bun is running?

1.1.7+b0b7db5c0

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

import { $ } from "bun";

const args = process.argv;

if (args.length  === 3) {
    const results = await $`ffmpeg -i ${args[2]} -c copy ${args[2].replaceAll("_", " ")}`;
    console.log(results.exitCode);
}

What is the expected behavior?

This code should be run under any path

What do you see instead?

ENOENT: No such file or directory
   errno: -2
 syscall: "open"

      at BunShell (:184:69)
      at D:\REC\新建文件夹\ffcopy.js:7:27

Additional information

No response

lvzhenbo avatar May 04 '24 05:05 lvzhenbo

Bun shell does support non-ascii paths. Try running the following, does it work?

import { $ } from "bun";

const args = "新建文件";
const results = await $`echo foo > ${args}.txt`;

What is suspicious is that the error you shared indicates that the open syscall was executed, but the code you shared should not do that.

Could you please give me a value for args[2] that can reproduce this error?

zackradisic avatar May 10 '24 15:05 zackradisic

I think you misunderstood, I meant the path where the executable is located

lvzhenbo avatar May 10 '24 15:05 lvzhenbo

image

lvzhenbo avatar May 10 '24 15:05 lvzhenbo

Thanks for clarifying, definitely looks like a problem with cwd having non ascii paths

zackradisic avatar May 11 '24 18:05 zackradisic