I think Fish command substitutions are treated as background processes. It looks like the `ssh` command is being stopped (see `jobs`), and if you resume it, it complains that tcsetattr() was interrupted. The documentation on tcsetattr() says:
> Unless otherwise noted for a specific command, these functions are restricted > from use by background processes. Attempts to perform these operations shall > cause the process group to be sent a SIGTTOU signal. The default action for SIGTTOU is to stop the process. So I imagine the command substitution is a background process, and ssh receives SIGTTOU when it calls tcsetattr(). This causes it to be stopped, and this causes Fish to proceed as if the command substitution is finished. For comparison, the ssh command works in Bash, but I assume Bash is not treating command substitutions as background processes. -Kevin > On Aug 20, 2014, at 11:20 PM, Rickard von Essen <rickard.von.es...@gmail.com> > wrote: > > Ok, thanks for all support. > > To summarise, the problem comes from the pseudo-tty assignment in ssh. When > something in a command substitution (command) assign a pseudo-tty fish > replaces this with nothing (and actually swallow surrounding text ?!). > Disabling pseudo-tty allocation solves this. > > For reference, this is what I ended up with: > function vip > vagrant ssh $argv[1] -c "ifconfig eth1 | sed -ne 's/.*inet > addr:\(\S*\)\s*Bcast.*/\1/p'" -- -T ^ /dev/null > end > > function vurl > open "http://"(vip)"$argv[2]/$argv[1]" > end > > I'll guess I should report a bug on this: > $ echo "Say "(ssh -T HOST echo Hi)"!" > Killed by signal 1. > Say Hi! > $ echo "Say "(ssh -t HOST echo Hi)"!" > > $ > > Regards > Rickard > > > On Wed, Aug 20, 2014 at 4:44 PM, Michael Stillwell <m...@beebo.org > <mailto:m...@beebo.org>> wrote: > > On Wed, Aug 20, 2014 at 3:05 PM, Glenn Jackman <jack...@pythian.com > > <mailto:jack...@pythian.com>> wrote: > >> > >> This got me at first too. Command substitution returns a *list*, not just > >> a string. When you prefix a list with a string ("http://"), that string is > >> prefixed onto each member of the list: > >> > >> $ function tmp; echo 1; echo 2; echo 3; end > >> $ echo "foo"(tmp) > >> foo1 foo2 foo3 > >> > >> If the list is empty, the string is prefixed onto nothing, hence the empty > >> output. > > Wow, interesting that "foo (...)" might behave so differently to "foo(...)"! > > Playing with this a bit: > > $ echo foo (echo "bar baz") > foo bar baz > $ echo foo(echo "bar baz") > foobar baz > $ echo foo (echo -e "bar\nbaz") > foo bar baz > > But (!): > > $ echo foo(echo -e "bar\nbaz") > foobar foobaz > > > > > Michael > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ <http://tv.slashdot.org/> > _______________________________________________ > Fish-users mailing list > Fish-users@lists.sourceforge.net <mailto:Fish-users@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/fish-users > <https://lists.sourceforge.net/lists/listinfo/fish-users> > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/_______________________________________________ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/
_______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users