You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The complete command doesn't work with interactive commands #8539
A:external-commandsIssues related to external commandsA:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRA:streamingIssues related to streaming data (or collecting data when it should be streamed)
I tried this on the latest main, and this variation seems to work for me: run-external --redirect-stderr atuin search "--interactive" | complete | $in.stderr
The reason the original one isn't working is because complete is getting, by default, stdout rather than stderr. So you need to go through the helper command to turn off the stdout and turn on the stderr.
A:external-commandsIssues related to external commandsA:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRA:streamingIssues related to streaming data (or collecting data when it should be streamed)
Activity
sophiajt commentedon Mar 20, 2023
Does
do -i { atuin search --interactive } | completework?doby default doesn't redirect stderrstevenxxiu commentedon Mar 20, 2023
Nope this has the same behavior as described above. No output shows at first, then once
Ctrl + Cis pressed, the interactive output shows up.sophiajt commentedon Mar 20, 2023
Makes me wonder if it doesn't want
stdoutredirected?vimand similar editors have this behaviour. If so, we'd have to redirect onlystderrand notstdout.stevenxxiu commentedon Mar 20, 2023
Yup that's the issue here.
stevenxxiu commentedon Mar 21, 2023
Related to Redirect
stderr· Issue #8277 · nushell/nushell.sophiajt commentedon Mar 27, 2023
I tried this on the latest main, and this variation seems to work for me:
run-external --redirect-stderr atuin search "--interactive" | complete | $in.stderrsophiajt commentedon Mar 28, 2023
The reason the original one isn't working is because
completeis getting, by default,stdoutrather thanstderr. So you need to go through the helper command to turn off thestdoutand turn on thestderr.stevenxxiu commentedon Mar 28, 2023
Thanks, that works indeed. I suppose for
completeto work with interactive commands I can just userun-external.fdncred commentedon Mar 28, 2023
Seems like we need to document the reason for why/how
run-externalworks. Maybe on the bash to nushell page? It's a little odd.On the other hand, this bash syntax is A LOT odd
-i -- "$0" 3>&1 1>&2 2>&3' (commandline))🤣zhiburt commentedon Mar 30, 2023
Hi there;
Just a note that run-external works only with binaries but not builtin commands;
fdncred commentedon Mar 30, 2023
Related to this issue and with atuin, we found out this worked
run-external --redirect-stderr atuin search "--interactive" | complete | $in.stderr.Good point @zhiburt.
run-externalis not meant for internal commands. The error message could be more helpful though.