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

Starts twice on init #2408

Closed
Profpatsch opened this issue Sep 19, 2015 · 5 comments
Closed

Starts twice on init #2408

Profpatsch opened this issue Sep 19, 2015 · 5 comments

Comments

@Profpatsch
Copy link

When I start fish on Nixos, it execve’s itself again after loading the config files. This way if I e.g. add echo foo to /etc/fish/config.fish it gets printed twice.

The nixos-part of this issue is here: NixOS/nixpkgs#9914

First off:

> readlink result
/nix/store/ns7kvqk9ybzvhp5q88ya1hka0xf45lw6-fish-2.2.0

1: (strace -f result/bin/fish)

22294 execve("result/bin/fish", ["result/bin/fish"], [/* 68 vars */]) = 0
…
22299 execve("/nix/store/ns7kvqk9ybzvhp5q88ya1hka0xf45lw6-fish-2.2.0/bin/fish", ["/nix/store/ns7kvqk9ybzvhp5q88ya1"..., "-c", "fish_update_completions > /dev/n"...], [/* 68 vars *

2: (fish -p)

> env fish_log_forks=1 result/bin/fish
546: g_fork_count: 0
starting to read initsourcing data config
…
fork #1: Executing keepalive fork for 'echo "begin; $argv "\n" ;end <&3 3<&-" | source 3<&0'
fork #2: Executing fork for internal builtin for 'echo'
fork #3: forking for '/nix/store/r8m8d2r74dkn4amqlyhywqx30s8ycw8w-fish-2.2.0/bin/fish' in '-'
546: g_fork_count: 0
starting to read initsourcing data config
@faho
Copy link
Member

faho commented Sep 19, 2015

If I understand the packaging recipe correctly, this is basically pure fish 2.2.0, only with some sed-patching to make nix's directory structure work?

22294 execve("result/bin/fish", ["result/bin/fish"], [/* 68 vars */]) = 0
22299 execve("/nix/store/ns7kvqk9ybzvhp5q88ya1hka0xf45lw6-fish-2.2.0/bin/fish"

If I understand this correctly, that's your self-built fish execing system fish? Does it also occur with system fish?

@zanchey
Copy link
Member

zanchey commented Sep 20, 2015

This looks like the built-in fish_update_completions running from __fish_config_interactive.

@faho
Copy link
Member

faho commented Sep 20, 2015

Yes, that sure does look like it.

How about we move the redirection to the fish call, not the function call? Unless we want to change that config.fish is always sourced, that seems to be the only thing we can do. Though it should probably call "this fish", not system fish.

@zanchey
Copy link
Member

zanchey commented Sep 20, 2015

I don't think this is a bug. That the output of config.fish is displayed is something that should be fixed with if status --is-interactive in config.fish, not by hiding the output from a normal fish invocation.

This block should only run once to generate completions; if it's more than that, then there is a bug.

@faho
Copy link
Member

faho commented Sep 28, 2015

@Profpatsch: That fish starts twice is a "feature" (well, more of a hacky workaround). Unless it's always starting (it should only do it once if ~/.local/share/fish/generated_completions doesn't exist), there's no real bug here. Therefore I am closing this. If it always starts, please say so and we'll reopen.

@faho faho closed this as completed Sep 28, 2015
@faho faho added the invalid label Sep 28, 2015
@krader1961 krader1961 modified the milestone: will-not-implement Nov 22, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants