Post AXrXmz18gji4ZWPX2e by akater@shitposter.club
 (DIR) More posts by akater@shitposter.club
 (DIR) Post #AXo2wUw8llZK1QcHOS by mitchmarq42xyz@emacs.ch
       2023-07-18T03:30:37Z
       
       0 likes, 0 repeats
       
       #elisp question, following on from earlier:How do you run an interactive shell command in #emacs --batch mode?
       
 (DIR) Post #AXo3iAFSzVpxl5NwH2 by crmsnbleyd@emacs.ch
       2023-07-18T03:39:15Z
       
       0 likes, 0 repeats
       
       @mitchmarq42xyz you can just use it as a function as long as the arguments are there, AFAIK
       
 (DIR) Post #AXo4qGOy65kr75FtSa by mitchmarq42xyz@emacs.ch
       2023-07-18T03:51:55Z
       
       0 likes, 0 repeats
       
       @crmsnbleyd you'd think so, and it does do the thing in the background. But the terminal isn't connected. I'm sure there's a workaround...
       
 (DIR) Post #AXrXmz18gji4ZWPX2e by akater@shitposter.club
       2023-07-19T02:38:35.145145Z
       
       0 likes, 0 repeats
       
       @mitchmarq42xyz  I don't: --batch is specifically non-interactive.  What's the problem you're trying to solve?
       
 (DIR) Post #AXrXmzkVy20QqFdllg by mitchmarq42xyz@emacs.ch
       2023-07-19T20:00:24Z
       
       0 likes, 0 repeats
       
       @akater I'm writing an elisp wrapper around a long-running shell command that requires input.
       
 (DIR) Post #AXvUc4p9Eje8AIkXKq by akater@shitposter.club
       2023-07-21T14:19:33.752323Z
       
       0 likes, 0 repeats
       
       @mitchmarq42xyz  Why not comint?
       
 (DIR) Post #AXvUc5jrpr150DHpk8 by mitchmarq42xyz@emacs.ch
       2023-07-21T17:43:38Z
       
       0 likes, 0 repeats
       
       @akater only works with a full emacs session. In batch mode any comint thing exits instantly.
       
 (DIR) Post #AXvfeO19wddRlhfhtw by mitchmarq42xyz@emacs.ch
       2023-07-21T19:47:19Z
       
       0 likes, 0 repeats
       
       Okay soThe reason async-shell-commands don't happen in batch mode is that they get killed when #Emacs exits. Having logic that takes some amount of time afterwards (such as a (sleep-for)) fixes this partially.Now I just need a helper loop that dumps the contents of the buffer to the echo area then asks for input on the last one. Coming together okay so far.
       
 (DIR) Post #AXxVTkZX8ZFXJCxXTk by akater@shitposter.club
       2023-07-22T10:57:24.275615Z
       
       0 likes, 0 repeats
       
       @mitchmarq42xyz  Of course; but why do you insist on --batch?  I wrote non-neglible amount of Elisp to work in batch mode specifically but I never even considered targeting any task that requires interactive input.
       
 (DIR) Post #AXxVTm4PZFXjxGPiFM by mitchmarq42xyz@emacs.ch
       2023-07-22T17:02:47Z
       
       0 likes, 0 repeats
       
       @akater the script should work eitherLoaded into the running EmacsAs a standalone scriptAnd take advantage of whatever features are available.Sometimes I'm at home and want to run it with all the bells and whistles. Other times I'm far away with only ssh and I'd at least like to operate it.The specific thing I'm wrapping in this instance is an anime downloader. But ideally there would just be a library that abstracts this sort of input - and I intend to write it.