From e0905093393a8674d26a486c108a510fddb22c65 Mon Sep 17 00:00:00 2001 From: Xevion Date: Wed, 11 Jun 2025 15:28:28 -0500 Subject: [PATCH] Remove special p10k/Cursor handling, use VSCode shell integration properly --- home/dot_bashrc.tmpl | 2 ++ home/dot_zshrc.tmpl | 38 +++++++++++++------------------------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/home/dot_bashrc.tmpl b/home/dot_bashrc.tmpl index 222b9f0..43d5124 100644 --- a/home/dot_bashrc.tmpl +++ b/home/dot_bashrc.tmpl @@ -102,6 +102,8 @@ if command -v thefuck &> /dev/null; then eval $(thefuck --alias) fi +[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)" + {{/* Common shared aliases, scripts, & shell setup details. */ -}} {{ template "scripts/commonrc.sh.tmpl" dict "data" . "shell" "bash" }} diff --git a/home/dot_zshrc.tmpl b/home/dot_zshrc.tmpl index 181b0e2..076977f 100644 --- a/home/dot_zshrc.tmpl +++ b/home/dot_zshrc.tmpl @@ -23,34 +23,20 @@ DISABLE_AUTO_UPDATE="true" # required for chezmoi external management # DISABLE_UNTRACKED_FILES_DIRTY="true" # HIST_STAMPS="mm/dd/yyyy" -# Set Oh My Zsh theme conditionally -if [[ "$TERM_PROGRAM" == "vscode" ]]; then - ZSH_THEME="" # Disable Powerlevel10k for Cursor - - # Plugins limited as they're mostly just aliases, not useful to the Cursor agent - plugins=(asdf) -else - # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes - ZSH_THEME="powerlevel10k/powerlevel10k" +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="powerlevel10k/powerlevel10k" - # TODO: Switch from 'asdf' to 'mise' - plugins=( - git gh fzf docker-compose docker deno chezmoi asdf yarn golang sudo zoxide bun npm brew zsh-autosuggestions F-Sy-H thefuck - {{- if .wsl -}} - {{ " kitty" }} - {{- end}} - ) -fi +# TODO: Switch from 'asdf' to 'mise' +plugins=( + git gh fzf docker-compose docker deno chezmoi asdf yarn golang sudo zoxide bun npm brew zsh-autosuggestions F-Sy-H thefuck + {{- if .wsl -}} + {{ " kitty" }} + {{- end}} +) source $ZSH/oh-my-zsh.sh -# Use a minimal prompt in Cursor to avoid command detection issues -if [[ "$TERM_PROGRAM" == "vscode" ]]; then - PROMPT='%n@%m:%~%# ' - RPROMPT='' -else - [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh # configure with `p10k configure` -fi +[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh # configure with `p10k configure` # {{ if lookPath "bw" -}} eval "$(bw completion --shell zsh); compdef _bw bw;" {{ end }} @@ -58,4 +44,6 @@ fi {{ template "scripts/commonrc.sh.tmpl" dict "data" . "shell" "zsh" }} {{/* Chezmoi's shell completion */ -}} -{{ completion "zsh" }} \ No newline at end of file +{{ completion "zsh" }} + +[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)" \ No newline at end of file