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

Issues with :sh #12992

Closed
abrassel opened this issue Feb 28, 2025 · 7 comments
Closed

Issues with :sh #12992

abrassel opened this issue Feb 28, 2025 · 7 comments

Comments

@abrassel
Copy link

I'm following https://yazi-rs.github.io/docs/tips/#helix-with-zellij to open yazi in helix, but I'm getting the following error:

y = ":sh zellij run -c -f -x 10% -y 10% --width 80% --height 80% -- bash ~/.config/helix/yazi-picker.sh open"

(with nushell)

results in:

`run-shell-command`: unknown variable: `-y`

note: this command works when manually run from the command line. is there some kind of parsing issue?

@david-crespo
Copy link
Contributor

You might have to escape those percents with \%. Are you on latest master after #12527 rewrote all the command parsing?

See https://docs.helix-editor.com/master/command-line.html

@abrassel
Copy link
Author

it does seem like an escaping issue, but when i wrote % instead, i got an "invalidescapesequence" error. This is from latest master build.

@abrassel
Copy link
Author

y = ":sh zellij run -c -f -x '10%' -y '10%' --width '80%' --height '80%' -- bash ~/.config/helix/yazi-picker.sh open"

@abrassel
Copy link
Author

(there are escapes, but they got eaten by markdown formatting)

@david-crespo
Copy link
Contributor

david-crespo commented Mar 1, 2025

Sorry, I misread this in the docs:

The backslash may also be used to escape quote characters (', `, ") or the percent token (%) when used at the beginning of an argument. :echo \%%sh{foo} for example prints %sh{foo} instead of invoking a foo shell command

The relevant line was actually this:

To escape a percent character instead of treating it as an expansion, use two percent characters consecutively

This works for me:

:sh echo hello 10%%

@abrassel
Copy link
Author

abrassel commented Mar 2, 2025

yeah - that worked for me :)

Is there an easy way to file a feature request to improve the error messaging?

@david-crespo
Copy link
Contributor

You could just change the title of this issue and update the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants