From 710db869332c49a4adac8ed35225ffdc91a7b59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 5 Aug 2026 20:12:12 +0200 Subject: [PATCH] fix(jonathan): make compatible with Ghostty shell-integration The issue is that Ghostty shell-integration tries to parse PS1. How we're defining it now, the precmd function from Ghostty does not properly read the newlines, resulting in broken prompts. This doesn't happen if: - Zsh is reloaded (`omz reload` or `exec zsh`) - Ghostty shell integration is disabled (`shell-integration = none` in config) This fix just removes the newlines, and it's enough to fix the integration. --- themes/jonathan.zsh-theme | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index 336a4f192..1e67f17a8 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -60,14 +60,7 @@ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} %{%G═%}" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} %{%G✭%}" # Use extended characters to look nicer if supported. -if [[ "${TERM_PROGRAM:-}" = ghostty ]]; then - PR_SET_CHARSET="" - PR_HBAR="-" - PR_ULCORNER="-" - PR_LLCORNER="-" - PR_LRCORNER="-" - PR_URCORNER="-" -elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then +if [[ "${langinfo[CODESET]}" = UTF-8 ]]; then PR_SET_CHARSET="" PR_HBAR="─" PR_ULCORNER="┌" @@ -109,25 +102,11 @@ else fi # Finally, the prompt. -PROMPT='${PR_SET_CHARSET}${PR_STITLE}${(e)PR_TITLEBAR}\ -${PR_CYAN}${PR_ULCORNER}${PR_HBAR}${PR_GREY}(\ -${PR_GREEN}%${PR_PWDLEN}<...<%~%<<\ -${PR_GREY})$(virtualenv_prompt_info)$(ruby_prompt_info)$(conda_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(\ -${PR_CYAN}%(!.%SROOT%s.%n)${PR_GREY}@${PR_GREEN}%m:%l\ -${PR_GREY})${PR_CYAN}${PR_HBAR}${PR_URCORNER}\ - -${PR_CYAN}${PR_LLCORNER}${PR_BLUE}${PR_HBAR}(\ -${PR_YELLOW}%D{%H:%M:%S}\ -${PR_LIGHT_BLUE}%{$reset_color%}$(git_prompt_info)$(git_prompt_status)${PR_BLUE})${PR_CYAN}${PR_HBAR}\ -${PR_HBAR}\ ->${PR_NO_COLOUR} ' +PROMPT='${PR_SET_CHARSET}${PR_STITLE}${(e)PR_TITLEBAR}${PR_CYAN}${PR_ULCORNER}${PR_HBAR}${PR_GREY}(${PR_GREEN}%${PR_PWDLEN}<...<%~%<<${PR_GREY})$(virtualenv_prompt_info)$(ruby_prompt_info)$(conda_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(${PR_CYAN}%(!.%SROOT%s.%n)${PR_GREY}@${PR_GREEN}%m:%l${PR_GREY})${PR_CYAN}${PR_HBAR}${PR_URCORNER} +${PR_CYAN}${PR_LLCORNER}${PR_BLUE}${PR_HBAR}(${PR_YELLOW}%D{%H:%M:%S}${PR_LIGHT_BLUE}%{$reset_color%}$(git_prompt_info)$(git_prompt_status)${PR_BLUE})${PR_CYAN}${PR_HBAR}${PR_HBAR}>${PR_NO_COLOUR} ' # display exitcode on the right when > 0 return_code="%(?..%{$fg[red]%}%? ↵ %{$reset_color%})" -RPROMPT=' $return_code${PR_CYAN}${PR_HBAR}${PR_BLUE}${PR_HBAR}\ -(${PR_YELLOW}%D{%a,%b%d}${PR_BLUE})${PR_HBAR}${PR_CYAN}${PR_LRCORNER}${PR_NO_COLOUR}' +RPROMPT=' $return_code${PR_CYAN}${PR_HBAR}${PR_BLUE}${PR_HBAR}(${PR_YELLOW}%D{%a,%b%d}${PR_BLUE})${PR_HBAR}${PR_CYAN}${PR_LRCORNER}${PR_NO_COLOUR}' -PS2='${PR_CYAN}${PR_HBAR}\ -${PR_BLUE}${PR_HBAR}(\ -${PR_LIGHT_GREEN}%_${PR_BLUE})${PR_HBAR}\ -${PR_CYAN}${PR_HBAR}${PR_NO_COLOUR} ' +PS2='${PR_CYAN}${PR_HBAR}${PR_BLUE}${PR_HBAR}(${PR_LIGHT_GREEN}%_${PR_BLUE})${PR_HBAR}${PR_CYAN}${PR_HBAR}${PR_NO_COLOUR} '