From 32ea2277195ebd8c244f37285f64b135e6ba4d9e Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 7 Aug 2019 15:33:22 +1200 Subject: [PATCH] enable prefilling of buffer on start --- .gitignore.d/zsh | 1 + .zsh/aliases/rrsh | 2 +- .zsh/zshrc/99-prefill_prompt | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .zsh/zshrc/99-prefill_prompt diff --git a/.gitignore.d/zsh b/.gitignore.d/zsh index 17dd223..bfb3413 100644 --- a/.gitignore.d/zsh +++ b/.gitignore.d/zsh @@ -107,5 +107,6 @@ !/.zsh/zshrc/90-run-help !/.zsh/zshrc/95-watch-users !/.zsh/zshrc/99-getpw-override +!/.zsh/zshrc/99-prefill_prompt !/.zsh/zshrc/99-prompt_setup !/.zsh/zshrc/.gitignore diff --git a/.zsh/aliases/rrsh b/.zsh/aliases/rrsh index ea281ba..87ef78b 100644 --- a/.zsh/aliases/rrsh +++ b/.zsh/aliases/rrsh @@ -1,2 +1,2 @@ -() { ssh "${@:-}" -t /bin/su } +() { ssh "${@:-}" -t /bin/su - } compdef ${0}=ssh diff --git a/.zsh/zshrc/99-prefill_prompt b/.zsh/zshrc/99-prefill_prompt new file mode 100644 index 0000000..0b2562e --- /dev/null +++ b/.zsh/zshrc/99-prefill_prompt @@ -0,0 +1,15 @@ +# +# Allow prefilling of the prompt buffer +# +# Copyright © 1994–2019 martin f. krafft +# Released under the terms of the Artistic Licence 2.0 +# +# Source repository: http://git.madduck.net/v/etc/zsh.git +# + +if [[ -n "$ZSH_PREFILL_CMD" ]]; then + print -z - $ZSH_PREFILL_CMD + unset ZSH_PREFILL_CMD +fi + +# vim:ft=zsh -- 2.39.5