-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething that's not working as intendedSomething that's not working as intended
Milestone
Description
- Have you checked if problem occurs with fish 2.4.0?
- Tried fish without third-party customizations (check
sh -c 'env HOME=$(mktemp -d) fish')?
fish version installed (fish --version): fish, version 2.3.1
OS/terminal used: Debian Linux (jessie), xterm
I wrote a script using #!/usr/bin/fish. The script calls read. Works fine from command line but not when called from another script.
Reproduction steps
nr@homedog ~/net> call-fish-read
fish: Couldn't grab control of terminal
tcsetpgrp: Interrupted system call
nr@homedog ~/net> fish-read
say something⏎ asdf
asdf
nr@homedog ~/net> /usr/bin/fish --version
fish, version 2.3.1-dirty
Scripts are attached in a zip file, but it may be easier to view source here.
Here is fish-read:
#!/usr/bin/fish
read -p 'echo -n say something >&2 ' -l -s answer
echo $answer
and here is call-fish-read:
#!/bin/ksh
mumble=$(fish-read)
echo $mumble
N.B. I downloaded a nightly of fish 2.4.0 from SUSE, and behavior is even more frustrating---the shell just hangs trying to read file descriptor 3. Not sure what's up with that (I poked at it with strace -f.)
Would love to have a workaround that enables me to use a fish script as a tool in other scripts.
demo-scripts.zip
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that's not working as intendedSomething that's not working as intended