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

[BUG] Opening in interactive shell using xdg-open yields unexpected EOF #2413

Open
LnLcFlx opened this issue May 28, 2024 · 4 comments
Open
Labels

Comments

@LnLcFlx
Copy link

LnLcFlx commented May 28, 2024

Small description
xdg-open file.csv inside an interactive bash shell gives

%f': unexpected EOF while looking for matching `''

and exit code 1.

Expected result
Using xdg-open outside a terminal (e.g. a script) it successfully opens a new terminal and visidata inside of it.

Steps to reproduce

  1. set visidata.desktop as default app for some mimetype e.g. text/csv (e.g. in ~/.config/mimeapps.list)
  2. xdg-open file.csv

Additional context

  • Linux 6.9.2-arch1-1
  • Python 3.12.3
  • Kitty 0.35.0

This is probably due to some string escape problem in the line

Exec=bash -i -c 'vd %f'

in visidata.desktop

@LnLcFlx LnLcFlx added the bug label May 28, 2024
@midichef
Copy link
Contributor

midichef commented Jun 2, 2024

Can you see if it works if you change that line in visidata.desktop to:
Exec=vd %F

That's two changes: get rid of bash, and then make %f uppercase. %F is a list of files, according to documentation. I would expect it is more versatile than the lowercase %f that only handles one file.

I'd test it myself, but I can't figure out how to get my system to use visidata.desktop. I've run into a bit too much trouble trying to get xdg-mime default to work.

@LnLcFlx
Copy link
Author

LnLcFlx commented Jun 2, 2024

Can confirm this work (just having Exec=vd %F).

@midichef
Copy link
Contributor

midichef commented Jun 2, 2024

Thank you, I will submit the change.

@midichef
Copy link
Contributor

midichef commented Jun 2, 2024

@anjakefala
I just looked into the history of the .desktop file, that the current configuration worked for you in #1738. Can you check whether the simpler version works for you: Exec=vd %F? I based it on vim's .desktop file.

In particular, does it work for filenames that have spaces in the middle, and for opening multiple files at the same time?

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

No branches or pull requests

2 participants