-
Notifications
You must be signed in to change notification settings - Fork 150
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
Problem with the file chooser argument #466
Comments
I didn't know about this feature, and because I'm very interested in it, I can see if I find some clues |
Hi! joshuto --file-chooser --output-file ~/my-temp-file The selected file is written to the given temp-file. It's for example used in this NeoVim plugin, which add Joshuto as a way to open a file. |
Ah yes that seems to work thanks. It does still exit with an error though but I guess as long as it works it's fine. And that's funny, thanks for sharing that plugin, that's exactly the kind of thing I was looking to do |
Hmmm, not exactly an error, I guess: https://github.com/kamiyaa/joshuto/blob/6cabeb9c8308e5debc9eda3ef8dadda268545156/src/commands/quit.rs#L22C20-L22C20 If this is really not documented somewhere, I agree, it should be... |
I don't know much about exit codes to be honest, but shouldn't it be 0 if there was no problem with the operation? |
Yeah, I should document it somewhere |
Yeah, usually 0 means success. Non-zero means an error, but can also be used to communicate other things |
Should this be Line 219 in 2536838
|
ratatui/termion (not sure which one) doesn't allow for joshuto's output to be piped. This makes it a bit tricky to get joshuto to work with shell scripts. So the only other option is to pipe it to a file. joshuto --file-chooser > some_file.txt But this won't work either because joshuto outputs to stdout, which gets piped to the file. So the only sensible solution is to have joshuto --file-chooser 2> some_file.txt Hope this clears things up! |
I hope I'm not being blind but I can't find how to use the
--file-chooser
argument for this program. It is not mentioned in this doc page.When I run
joshuto --file-chooser
, the program works fine but exits with an error (102) after selecting a file. I would expect it to either output straight tostdout
or take an output file as an argument, so though I'm not even sure it makes sense, I also triedjoshuto --file-chooser --output-file temp.txt
and the result is the same.Any support would be appreciated, thanks.
The text was updated successfully, but these errors were encountered: