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

Unexpected end of file errors when launching terminal after self-updating (Linux) #18614

Open
1 task done
Jeff-SearchPilot opened this issue Oct 2, 2024 · 6 comments
Open
1 task done
Labels
bug [core label] installer / updater Feedback for installation and update process linux linux-wayland Linux Wayland terminal Feedback for terminal integration, shell commands, etc

Comments

@Jeff-SearchPilot
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

this is related to zed updating itself...

- install zed using the install script (`https://zed.dev/install.sh`)
    all ok, no errors when launching a terminal
- let zed update itself. Open a terminal..

Screenshot from 2024-10-02 09-17-09

- rerun install script and relaunch zed. Open a terminal and the errors no longer appear

Running Fedora 40, with zsh and others have reported similar issues in #14179 (which is similar but apparently unrelated)

Environment

Zed: v0.155.2 (Zed Preview)
OS: Linux Wayland fedora 40
Memory: 15.3 GiB
Architecture: x86_64
GPU: Intel(R) Xe Graphics (TGL GT2) || Intel open-source Mesa driver || Mesa 24.1.7

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
@Jeff-SearchPilot Jeff-SearchPilot added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Oct 2, 2024
@notpeter
Copy link
Member

notpeter commented Oct 2, 2024

Curious what your default shell is (getent passwd $USER) as those errors show /bin/sh and most folks use bash or zsh. Can you paste the complete set of errors shown when you open a clean terminal? (a new release should be out shortly today which will trigger an auto-update).

@Jeff-SearchPilot
Copy link
Author

Default shell is /usr/bin/zsh and here are the errors (same as the screenshot above)..

/usr/bin/sh: module: line 3: syntax error: unexpected end of file
/usr/bin/sh: error importing function definition for `module'
/usr/bin/sh: module: line 3: syntax error: unexpected end of file
/usr/bin/sh: error importing function definition for `module'
/usr/bin/sh: module: line 3: syntax error: unexpected end of file
/usr/bin/sh: error importing function definition for `module'

No idea what's calling /usr/bin/sh, I assume its something internal to zed since it only occurs after it self-updates

@JosephTLyons JosephTLyons added terminal Feedback for terminal integration, shell commands, etc installer / updater Feedback for installation and update process linux linux-wayland Linux Wayland and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 4, 2024
@notpeter
Copy link
Member

notpeter commented Oct 4, 2024

No idea what's calling /usr/bin/sh, I assume its something internal to zed since it only occurs after it self-updates

There's no explicit mention of /usr/bin/sh in the zed repo so Zed is discovering that shell specified somewhere on your system (perhaps incorrectly).

  1. Does the issue only occur when Zed relaunches itself after automatic update?
  2. Does it also occur if you quit Zed and spawn from the command line?
  3. Does it also occur if you quit Zed and spawn it from the desktop shortcut?

On Fedora 40 /usr/bin/sh is a symlink to /usr/bin/bash. I wonder if you have something inside your .profile or /etc/profile which is zsh-specific and causing bash to puke.

My apologies for what might sound patronizing by asking again, can you confirm your default shell is actually zsh by running chsh and seeing what it says there? I only ask again because I have previously encountered people who were using zsh but had not configured as their default shell (just being launched as a subprocess from .bashrc or whatever) and I want to explicitly rule that out.

Could you also try explicitly defining your Terminal Shell in zed settings?

{
  "terminal": {
    "shell": {
      "program": "zsh"
    }
  }
}
  1. Can you see if that helps?
  2. Does setting it to bash trigger than issue again?

@Jeff-SearchPilot
Copy link
Author

Oddly enough, I've noticed this morning that the error has disappeared without me having to rerun the install script. So it could well be related to that initial run after the update. I'll do some more testing when the next update is pushed out and have set the shell to zsh as suggested.

@Jeff-SearchPilot
Copy link
Author

Confirmed that the issue only occurs the first time zed runs after an auto-update. Closing and relaunching results in normal behaviour with no errors. Launching from terminal/desktop shortcut doesnt make a difference.

Also double checked and confirmed zed is 100% my shell. Setting the terminal shell in zed settings also had no affect.

@github-actions github-actions bot added admin read Pending admin review triage Maintainer needs to classify the issue labels Nov 5, 2024
@notpeter notpeter removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 5, 2024
@Jeff-SearchPilot
Copy link
Author

This appears to have resolved itself in one of the recent releases. I'll double check when the next release is made but i think this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] installer / updater Feedback for installation and update process linux linux-wayland Linux Wayland terminal Feedback for terminal integration, shell commands, etc
Projects
None yet
Development

No branches or pull requests

3 participants