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

bun shell does not support Chinese paths #10816

Open
lvzhenbo opened this issue May 4, 2024 · 4 comments
Open

bun shell does not support Chinese paths #10816

lvzhenbo opened this issue May 4, 2024 · 4 comments
Labels
bug Something isn't working shell Something to do with Bun as a shell

Comments

@lvzhenbo
Copy link

lvzhenbo commented May 4, 2024

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 lvzhenbo added the bug Something isn't working label May 4, 2024
@zackradisic zackradisic added the shell Something to do with Bun as a shell label May 10, 2024
@zackradisic
Copy link
Contributor

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?

@lvzhenbo
Copy link
Author

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

@lvzhenbo
Copy link
Author

image

@zackradisic
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working shell Something to do with Bun as a shell
Projects
None yet
Development

No branches or pull requests

2 participants