Skip to content

Commit 2808b6a

Browse files
kidonnggnachman
authored andcommitted
Improve Fish shell integration script
1 parent c5c9198 commit 2808b6a

File tree

1 file changed

+5
-5
lines changed
  • shell_integration

1 file changed

+5
-5
lines changed

shell_integration/fish

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# along with this program; if not, write to the Free Software
1313
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1414

15-
if begin; status --is-interactive; and not functions -q -- iterm2_status; and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen ]; and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen-256color ]; and [ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != tmux-256color ]; and [ "$TERM" != dumb ]; and [ "$TERM" != linux ]; end
15+
if begin; status --is-interactive; and not functions -q -- iterm2_status; and test "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen; and test "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen-256color; and test "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != tmux-256color; and test "$TERM" != dumb; and test "$TERM" != linux; end
1616
function iterm2_status
1717
printf "\033]133;D;%s\007" $argv
1818
end
@@ -30,7 +30,7 @@ if begin; status --is-interactive; and not functions -q -- iterm2_status; and [
3030
# Tell terminal to create a mark at this location
3131
function iterm2_preexec --on-event fish_preexec
3232
# For other shells we would output status here but we can't do that in fish.
33-
if [ "$TERM_PROGRAM" = "iTerm.app" ]
33+
if test "$TERM_PROGRAM" = "iTerm.app"
3434
printf "\033]133;C;\r\007"
3535
else
3636
printf "\033]133;C;\007"
@@ -67,7 +67,7 @@ if begin; status --is-interactive; and not functions -q -- iterm2_status; and [
6767

6868
iterm2_status $last_status
6969
iterm2_write_remotehost_currentdir_uservars
70-
if not functions iterm2_fish_prompt | grep -q iterm2_prompt_mark
70+
if not functions iterm2_fish_prompt | string match -q "*iterm2_prompt_mark*"
7171
iterm2_prompt_mark
7272
end
7373
return $last_status
@@ -112,7 +112,7 @@ if begin; status --is-interactive; and not functions -q -- iterm2_status; and [
112112
if not set -q -g iterm2_hostname
113113
# hostname -f is fast on macOS so don't cache it. This lets us get an updated version when
114114
# it changes, such as if you attach to a VPN.
115-
if [ (uname) != Darwin ]
115+
if test (uname) != Darwin
116116
set -g iterm2_hostname (hostname -f 2>/dev/null)
117117
# some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option
118118
if test $status -ne 0
@@ -122,5 +122,5 @@ if begin; status --is-interactive; and not functions -q -- iterm2_status; and [
122122
end
123123

124124
iterm2_write_remotehost_currentdir_uservars
125-
printf "\033]1337;ShellIntegrationVersion=18;shell=fish\007"
125+
printf "\033]1337;ShellIntegrationVersion=19;shell=fish\007"
126126
end

0 commit comments

Comments
 (0)