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

Can't preview string with nul byte #278

Closed
Aloxaf opened this issue Feb 29, 2020 · 2 comments
Closed

Can't preview string with nul byte #278

Aloxaf opened this issue Feb 29, 2020 · 2 comments

Comments

@Aloxaf
Copy link

Aloxaf commented Feb 29, 2020

> sk --preview-window=down --preview='echo {}' <<<$'abc\0cba'

Got an error:

图片

lotabout added a commit that referenced this issue Mar 1, 2020
Now NUL will be translated back to `\0` when invoking execute or preview
command.

It may not be expected in all cases, but it is the best we can do for
now.
@lotabout
Copy link
Owner

lotabout commented Mar 1, 2020

Current fix will translate NUL character to \0 before invoking the command. However if the command did not understand the meaning of \0 then it won't work.

lotabout added a commit that referenced this issue Mar 1, 2020
Now NUL will be translated back to `\0` when invoking execute or preview
command.

It may not be expected in all cases, but it is the best we can do for
now.
lotabout added a commit that referenced this issue Mar 1, 2020
Now NUL will be translated back to `\0` when invoking execute or preview
command.

It may not be expected in all cases, but it is the best we can do for
now.
lotabout added a commit that referenced this issue Mar 1, 2020
Fix #278: NUL not working in preview cmd
@Aloxaf
Copy link
Author

Aloxaf commented Mar 1, 2020

Another solution is to support {f}, which can write the string to a temp file.

eg.

fzf --preview='echo "$(<{f})"' <<<$'abc\0abc'

makovich pushed a commit to makovich/skim that referenced this issue May 28, 2020
Now NUL will be translated back to `\0` when invoking execute or preview
command.

It may not be expected in all cases, but it is the best we can do for
now.
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