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

Fish shell Unknown option "--function" when launching ghostty #43

Open
cblument opened this issue Jan 13, 2025 · 2 comments
Open

Fish shell Unknown option "--function" when launching ghostty #43

cblument opened this issue Jan 13, 2025 · 2 comments

Comments

@cblument
Copy link

Fish shell Unknown option "--fucntion" when launching ghostty looking through fish release notes for fish shell and --function was added in 3.4.0 of fish which is newer than what is in ubuntu 22.04

I recognize that the likely resolution to this will be a suggestion to upgrade to newer version of fish and/or newer version of ubuntu which I am fine with. I just want to document the issue for future people that may run into the issue.

https://fishshell.com/docs/current/relnotes.html#fish-3-4-0-released-march-12-2022

set: Unknown option “--function”

/usr/share/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish (line 17):
    set --function --path xdg_data_dirs "$XDG_DATA_DIRS"
    ^
in function 'ghostty_restore_xdg_data_dir'
        called on line 41 of file /usr/share/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
from sourcing file /usr/share/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup

(Type 'help set' for related documentation)
set: Unknown option “--function”

/usr/share/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish (line 20):
    if set --function index (contains --index "$GHOSTTY_SHELL_INTEGRATION_XDG_DIR" $xdg_data_dirs)
       ^
in function 'ghostty_restore_xdg_data_dir'
        called on line 41 of file /usr/share/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
from sourcing file /usr/share/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
        called on line 253 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup

(Type 'help set' for related documentation)
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

~ via 🐍 v3.11.4
❯ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

~ via 🐍 v3.11.4
❯ dpkg -l | grep ghostty
ii  ghostty                                          1.0.1-0~ppa3                            amd64        Fast, feature-rich, and cross-platform terminal emulator.

~ via 🐍 v3.11.4
❯ fish --version
fish, version 3.3.1
@cblument
Copy link
Author

Steps to upgrade fish for ubuntu 22.04 and probably more can be found at https://launchpad.net/~fish-shell/+archive/ubuntu/release-3

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt install fish

@mkasberg
Copy link
Owner

It's great that you can add a ppa for a newer fish version to work around this!

However, I'm also open to the idea that the version of fish available in default Ubuntu 22.04 should work with the Ghostty .deb for 22.04. I think there are two possible paths to achieving this:

  • Patch ghostty-shell-integration.fish to avoid --function when building the .deb for ubutnu 22.04
  • OR, per the header at the top of that script, perhaps we can open an upstream issue with Ghostty to fix this since the header of that file says, "This shell script aims to be written in a way where it can't really fail or all failure scenarios are handled, so that we never leave the shell in a weird state. If you find a way to break this, please report a bug!"

@mkasberg mkasberg reopened this Jan 18, 2025
@mkasberg mkasberg changed the title Fish shell Unknown option "--fucntion" when launching ghostty Fish shell Unknown option "--function" when launching ghostty Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants