Open OmegaLambda1998 opened 2 weeks ago
As for the commandline-parsing, see #2017 - that alone wouldn't help here though, as chained commands are asynchronous, there is no notation of "run this after the download finished". See #3007 for that.
As for the segfault you mention, I cannot reproduce. Could you please open a separate issue with more detailed reproduction steps (e.g. what website you were trying on, and with which link)?
Cool, I had browsed those issues previously but wasn't certain if the state had changed. I will create a new issue for the segfault, so this one can be closed
I suppose this one can stay open, you have a couple good points regarding e.g. the arguments for download
there.
So I've been trying for a while to get a hint keybind that will essentially open the download prompt (
:download {hint-url}
) and then automaticallyprompt-open-download
. If there's an pre-existing method to consistently do this, I'd love to know, as I haven't been able to find one. The ideas I had thusfar include:download-open
accept a url? Nope, gotta download, then open.hint target download;; prompt-open-download
? Nope, commands are asynchronous, so the download prompt isn't open when the prompt resolver is run.hint target run download --dest /tmp/whatever {hint-url} ;; download-open
hint target run fake-key -g "download {hint-url}<Return><Ctrl-x>"
! Nope, that causes a segfault (as does<Return><Return>
)The best workaround I found was
hint target download ;; cmd-later <some arbitrary amount of time> prompt-open-download
. Of course, this is unideal because either the cmd-later runs before I have selected a hint, or I have to awkwardly wait for the prompt to be accepted.Some suggestion for improvements which could help with this (and in general coud make a lot of similar issues easier to handle
An expansion to the --dest arg of
download
which has more options for how the download should be handled (download --dest [auto, file_selector, <destination string>] --action [open, pdfjs]
) whereauto -> Accept
,open -> Open download
,pdfjs -> Open download via PDF.js
,file_selector -> Launch external file selector
, and<destination_string>
functions as --dest normally does. You could even addrun
,fill
,userscript
, andspawn
handles which function similarly tohint
, perhaps storing the filepath in{download_path}
or the like.Better handling of command chains in
hint
,fake-key
, etc... In particular some way to encapsulate a complete chain of commands, for instancehint target run "cmd args ;; cmd args \"arg_with_quotes\""
or something similar. Or even just being able to pass--
to indicate everything after that is the command chain (hint target run -- cmd ;; cmd ;; cmd
,fake-key -g -- :cmd ;; cmd ;; cmd
)