From 66e0bf911be564f51ba15b020434dcbdc066f458 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 30 Jul 2018 09:29:00 +0100 Subject: [PATCH] zsh: replace perl pwd with POSIX sed variant --- .config/zsh/plugins/fish-theme.zsh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.config/zsh/plugins/fish-theme.zsh b/.config/zsh/plugins/fish-theme.zsh index 9e961ce..fa94787 100644 --- a/.config/zsh/plugins/fish-theme.zsh +++ b/.config/zsh/plugins/fish-theme.zsh @@ -1,12 +1,7 @@ # ZSH Theme emulating the Fish shell's default prompt. _fishy_collapsed_wd() { - echo $(pwd | perl -pe ' - BEGIN { - binmode STDIN, ":encoding(UTF-8)"; - binmode STDOUT, ":encoding(UTF-8)"; - }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g -') + pwd | sed -E 's|^'$HOME'|~|;s|(.*)/|\1%|;s|((^\|/)\.?[^/%]{1})[^/%]*|\1|g;s|(.*)%|\1/|' } git_prompt_info() {