Skip to content

✨ Stop editing users zsh file in order to set the terminal tab title #1640

@TeddyHuang-00

Description

@TeddyHuang-00

I am using xonsh which will source zshrc from its own rc file. However, I found the current shell integration injection (the code below) breaks the zsh grammar.

https://github.com/CodeEditApp/CodeEdit/blob/8f26014ee26597b2def50601a8c07452142bee8b/CodeEdit/Features/TerminalEmulator/TerminalEmulatorView.swift#L171C2-L182C14

This can be easily fixed if the following line

[[ "$TERM_PROGRAM" == "CodeEditApp_Terminal" ]] && . "/Applications/CodeEdit.app/Contents/Resources/codeedit_shell_integration.zsh"

was rewritten to

if [[ $TERM_PROGRAM == "CodeEditApp_Terminal" ]]; then
  source "/Applications/CodeEdit.app/Contents/Resources/codeedit_shell_integration.zsh"
fi

This is IMO a more compatible way to write these lines.

PLUS, I think it is a necessity to notice the users when manipulating their shell rc files! Not everyone will welcome unexpected rc file change!

Metadata

Metadata

Assignees

Type

No type

Projects

Status

🏁 Complete

Relationships

None yet

Development

No branches or pull requests

Issue actions