Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression for io redirection syntax #6614

Closed
u24b6 opened this issue Feb 16, 2020 · 7 comments
Closed

regression for io redirection syntax #6614

u24b6 opened this issue Feb 16, 2020 · 7 comments
Milestone

Comments

@u24b6
Copy link

u24b6 commented Feb 16, 2020

  • Version: fish, version 3.1.0 (echo reports the same)
  • Terminal: elementary (TERM=xterm-256color)
  • uname: Linux luna 5.5.0_1 Need a history built-in #1 SMP Mon Feb 3 02:14:31 UTC 2020 aarch64 GNU/Linux
  • distro: void

had a snippet which worked well before but no longer works. involves io redirection. snippet/error can be found below:

~/.config/fish/config.fish (line 8): Expected a string, but instead found a '&'
	exec startup --user 1>>~/.cache/startup.log 2>>&1
	                                               ^
from sourcing file ~/.config/fish/config.fish
	called during startup
source: Error while reading file '/home/person/.config/fish/config.fish'

I am not using any customizations, this is a fresh install and I had the same issue on my old customized installation

@faho
Copy link
Member

faho commented Feb 16, 2020

"Append to an fd" doesn't really make any sense. You write to where the fd currently is or you don't, the difference between "append" vs "overwrite" happens earlier, when the initial write position is chosen.

I'd be okay with accepting the second ">" for compatibility, but we'd be doing nothing with it.

So, as a workaround: Use 2>&1. That'll do the exact same thing.

@floam
Copy link
Member

floam commented Feb 16, 2020

I'd be okay with accepting the second ">" for compatibility,

Produces an error in bash and ksh93 FWIW.

@floam
Copy link
Member

floam commented Feb 16, 2020

Er, duh, it worked in past fish versions. And just checked, works in zsh.

@floam
Copy link
Member

floam commented Feb 16, 2020

With fish 3.1, you can also just do: exec startup --user &>> ~/.cache/startup.log to append both stderr and stdout.

@zanchey zanchey added this to the fish-future milestone Feb 16, 2020
@thesocialdev
Copy link

thesocialdev commented Feb 16, 2020

This is also breaking some plugin installations like nvm.

@thesocialdev
Copy link

thesocialdev commented Feb 16, 2020

I had to temporarily downgrade fish for Ubuntu bionic 18.04, see:

sudo apt install fish=2.7.1-3 fish-common=2.7.1-3

@faho faho modified the milestones: fish-future, fish 3.1.1 Feb 17, 2020
@faho faho closed this as completed in aba900a Feb 17, 2020
zanchey pushed a commit that referenced this issue Feb 22, 2020
Appending to an fd doesn't really make sense, but we allowed the
syntax previously and it was actually used.

It's not too harmful to allow it, so let's just do that again.

For the record: Zsh also allows it, bash doesn't.

Fixes #6614

(cherry picked from commit aba900a)
@dkowis
Copy link

dkowis commented Apr 23, 2020

This is now the default version of fish shell that ships with ubuntu 20.04 :(

So that means that fish shell is broken out of the box on Ubuntu 20.04. I have filed this: https://bugs.launchpad.net/ubuntu/+source/fish/+bug/1874560 Perhaps the ubuntu community will consider pulling in the single commit to fix their package.

A 3.1.1 from the PPA would be appreciated to help along, as I don't think I have an option to use an older version at this point.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants