Skip to content

Commit 5375c5e

Browse files
committed
interactive.*: dropping our carapace integration
autocomplete scripts are a recurrent failure point for initialisation, which then is perceived as a dorothy issue (in some way it is) as such, drop automatic autocomplete loading, and have it up to the user to integrate carapace-sh/carapace-bin#3685
1 parent dea4ca2 commit 5375c5e

8 files changed

Lines changed: 11 additions & 109 deletions

File tree

.github/workflows/dorothy-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
SLUG: ${{ needs.setup.outputs.SLUG }}
128128
COMMIT: ${{ needs.setup.outputs.COMMIT }}
129129
ACTION: install
130-
ARGUMENTS: -- --shells=bash,zsh,fish,nu,xonsh,elvish,dash,ksh --utils=carapace
130+
ARGUMENTS: -- --shells=bash,zsh,fish,nu,xonsh,elvish,dash,ksh
131131
- name: "Dorothy Login Shell: bash"
132132
shell: bash -leo pipefail {0}
133133
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ For each shell that you configured during the Dorothy installation (can be recon
309309
1. Load any common alias and function utilities.
310310
1. Load our theme configuration.
311311
1. Load our ssh configuration.
312-
1. Load our autocomplete configuration.
312+
1. Load our environment integrations.
313313

314314
This is the foundation that enables Dorothy's hundreds of commands to work across hundreds of machines, across dozens of operating system and shell combinations, seamlessly.
315315

commands/setup-util-nu

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,6 @@ function setup_util_nu() (
5555
fi
5656
removals+=("$autoload_path/starship.nu" "$XDG_STATE_HOME/starship/init.nu" "$state_path/sources/starship.nu") # deprecated
5757

58-
# carapace
59-
# https://carapace-sh.github.io/carapace-bin/setup.html#nushell
60-
if __command_exists -- carapace; then
61-
{
62-
__print_lines '#!/usr/bin/env nu'
63-
carapace _carapace nushell
64-
} >"$state_path/carapace.nu" || return $?
65-
else
66-
{ __print_lines '#!/usr/bin/env nu'; } >"$state_path/carapace.nu" || return $?
67-
fi
68-
removals+=("$autoload_path/carapace.nu" "$state_path/sources/carapace.nu" "$XDG_STATE_HOME/carapace/init.nu") # deprecated
69-
70-
# inshellisense
71-
# https://github.com/microsoft/inshellisense#shell-plugin
72-
if __command_exists -- inshellisense; then
73-
{
74-
__print_lines '#!/usr/bin/env nu'
75-
is init nu
76-
} >"$state_path/inshellisense.nu" || return $?
77-
else
78-
{ __print_lines '#!/usr/bin/env nu'; } >"$state_path/inshellisense.nu" || return $?
79-
fi
80-
8158
# dorothy configuration files
8259
if [[ -f "$DOROTHY/user/config.local/interactive.nu" ]]; then
8360
{ __print_lines '#!/usr/bin/env nu' "source $(__quoted_realpath "$DOROTHY/user/config.local/interactive.nu")"; } >"$state_path/interactive.nu" || return $?
@@ -91,7 +68,7 @@ function setup_util_nu() (
9168
removals+=("$autoload_path/dorothy-interactive.nu" "$state_path/config.local/interactive.nu" "$state_path/config/interactive.nu") # deprecated
9269

9370
# deprecated
94-
removals+=("$autoload_path/dorothy.nu")
71+
removals+=("$autoload_path/dorothy.nu" "$state_path/inshellisense.nu" "$autoload_path/carapace.nu" "$state_path/sources/carapace.nu" "$XDG_STATE_HOME/carapace/init.nu")
9572

9673
# removals
9774
if [[ ${#removals[@]} -ne 0 ]]; then

sources/interactive.elv

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ if ?(test -f $E:DOROTHY'/user/config.local/interactive.elv') {
2929
# Theme
3030
eval (cat $E:DOROTHY'/sources/theme.elv' | slurp)
3131

32-
# =====================================
33-
# Autocomplete
34-
35-
if ?( command-exists -- carapace ) {
36-
# carapace
37-
# https://carapace-sh.github.io/carapace-bin/setup.html#elvish
38-
eval (carapace _carapace elvish | slurp)
39-
}
40-
4132
# =====================================
4233
# Terminals
4334

sources/interactive.fish

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,10 @@ if command-exists -- ssh-agent
5252
end
5353

5454
# =====================================
55-
# Autocomplete
55+
# Integrations
5656

5757
# Visual Studio Code Terminal Shell Integration
5858
# https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation
5959
if test "$TERM_PROGRAM" = 'vscode' && command-exists -- code
6060
. (code --locate-shell-integration-path fish)
6161
end
62-
63-
# load
64-
if command-exists -- carapace
65-
# carapace
66-
# https://carapace-sh.github.io/carapace-bin/setup.html#fish
67-
carapace _carapace fish | source
68-
else if command-exists -- is
69-
# inshellisense
70-
# https://github.com/microsoft/inshellisense#shell-plugin
71-
is init fish | source
72-
end

sources/interactive.nu

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,3 @@ command-exists -- 'ssh-agent' | complete; if $env.LAST_EXIT_CODE == 0 {
4444
# trap not supported yet by nushell
4545
# https://github.com/nushell/nushell/issues/8360
4646
}
47-
48-
# =====================================
49-
# Autocomplete
50-
51-
# https://www.nushell.sh/book/custom_completions.html
52-
53-
command-exists -- 'carapace' | complete; if $env.LAST_EXIT_CODE == 0 {
54-
# carapace
55-
# https://carapace-sh.github.io/carapace-bin/setup.html#nushell
56-
source ~/.local/state/dorothy/carapace.nu
57-
} else {
58-
command-exists -- 'is' | complete; if $env.LAST_EXIT_CODE == 0 {
59-
# inshellisense
60-
# https://is-sh.github.io/is-bin/setup.html#nushell
61-
source ~/.local/state/dorothy/inshellisense.nu
62-
}
63-
}

sources/interactive.sh

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -100,49 +100,24 @@ fi
100100
# =====================================
101101
# Autocomplete
102102

103-
# Visual Studio Code Terminal Shell Integration
104-
# https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation
105-
if [ "${TERM_PROGRAM-}" = 'vscode' ] && command -v code >/dev/null 2>&1; then
106-
. "$(code --locate-shell-integration-path "$ACTIVE_POSIX_SHELL")"
107-
fi
108-
109103
if [ "$ACTIVE_POSIX_SHELL" = 'bash' ]; then
110104
# enable completions
111105
# trunk-ignore(shellcheck/SC3044)
112106
shopt -s progcomp
113-
114-
# load completions
115-
if command -v carapace >/dev/null 2>&1; then
116-
# carapace
117-
# https://carapace-sh.github.io/carapace-bin/setup.html#bash
118-
eval "$(carapace _carapace bash)"
119-
elif command -v is >/dev/null 2>&1; then
120-
# inshellisense
121-
# https://github.com/microsoft/inshellisense#shell-plugin
122-
eval "$(is init bash)"
123-
fi
124-
125107
elif [ "$ACTIVE_POSIX_SHELL" = 'zsh' ]; then
126108
# enable completions
127109
autoload -Uz compinit # -U load, -z zsh-style
128110
compinit
129-
130-
# load completions
131-
if command -v carapace >/dev/null 2>&1; then
132-
# carapace
133-
# https://carapace-sh.github.io/carapace-bin/setup.html#zsh
134-
# trunk-ignore(shellcheck/SC3003)
135-
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
136-
eval "$(carapace _carapace zsh)"
137-
elif command -v is >/dev/null 2>&1; then
138-
# inshellisense
139-
# https://github.com/microsoft/inshellisense#shell-plugin
140-
eval "$(is init zsh)"
141-
fi
142111
fi
143112

144113
# =====================================
145-
# Terminals
114+
# Integrations
115+
116+
# Visual Studio Code Terminal Shell Integration
117+
# https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation
118+
if [ "${TERM_PROGRAM-}" = 'vscode' ] && command -v code >/dev/null 2>&1; then
119+
. "$(code --locate-shell-integration-path "$ACTIVE_POSIX_SHELL")"
120+
fi
146121

147122
# Ghostty, it is here, because the title is better here, could be an issue with `oz`
148123
# https://ghostty.org/docs/features/shell-integration

sources/interactive.xsh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,3 @@ elif path.exists($DOROTHY + '/config/interactive.xsh'):
3333
# Theme
3434

3535
execx(compilex(open($DOROTHY + '/sources/theme.xsh').read()))
36-
37-
# =====================================
38-
# Autocomplete
39-
40-
if !(command-exists -- carapace).returncode == 0:
41-
# carapace
42-
# https://carapace-sh.github.io/carapace-bin/setup.html#xonsh
43-
COMPLETIONS_CONFIRM=True
44-
exec($(carapace _carapace xonsh))
45-
elif !(command-exists -- is).returncode == 0:
46-
# inshellisense
47-
# https://github.com/microsoft/inshellisense#shell-plugin
48-
is init xonsh

0 commit comments

Comments
 (0)