diff --git a/users/pbsds/home/default.nix b/users/pbsds/home/default.nix index 07f625b..7e284a5 100644 --- a/users/pbsds/home/default.nix +++ b/users/pbsds/home/default.nix @@ -167,6 +167,7 @@ bin = "${lib.getExe pkgs.netcat} termbin.com 9999"; denix = "sed -E 's@/nix/store/[^ /]+@@g'"; + denix-ellipsis = "sed -E 's@/nix/store/[^ /-]+-?@/nix/store/...@g'"; }; home.enableNixpkgsReleaseCheck = true; diff --git a/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh b/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh index f9d1103..a407aaa 100644 --- a/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh +++ b/users/pbsds/home/profiles/bashrc.d/zeditor-remote.sh @@ -11,7 +11,7 @@ zeditor-remote() { return 1 fi } - ensure xe fd fzf gum || return 1 + ensure xe fd rg fzf gum || return 1 local spin="" # doesn't forward stdin @@ -92,15 +92,21 @@ zeditor-remote() { rg <<<"$choice" '^ssh://([^/]*)/(~/.*)$' -r 'ssh -t "$1" "cd $2; \\$$SHELL -l"' ||: ) - if [[ -n "$ssh_cd_cmd" ]] && gum confirm "SSH in there now?" --default=yes; then + if [[ -n "$ssh_cd_cmd" ]]; then + local do_ssh="" + if gum confirm "SSH in there now?" --default=yes; then + do_ssh=1 + fi # history -s "${zed_cmd}" eval ${zed_cmd} # TODO: find a way to not push the rest of the unpushed history history -s "${ssh_cd_cmd}" history -a - printf >&2 "%s\n" "+ ${ssh_cd_cmd}" - eval ${ssh_cd_cmd} + if [[ -n "$do_ssh" ]]; then + printf >&2 "%s\n" "+ ${ssh_cd_cmd}" + eval ${ssh_cd_cmd} + fi else if [[ "$?" -eq 130 ]]; then return 1 # ctrl-c