From 4338d5c6a527249bd5bbfe797cba9ff4d0ddd8ac Mon Sep 17 00:00:00 2001 From: ZachIR Date: Fri, 28 Feb 2025 11:33:16 -0600 Subject: Add command_not_found handle for distrobox --- sh/profile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sh/profile') diff --git a/sh/profile b/sh/profile index 55657fa..ff237a1 100644 --- a/sh/profile +++ b/sh/profile @@ -130,3 +130,17 @@ addtopath "/var/lib/flatpak/exports/bin" unset -f addtopath unset USERPATH unset PATHS + +command_not_found_handle() { +# don't run if not in a container + if [ ! -e /run/.containerenv ] && [ ! -e /.dockerenv ]; then + exit 127 + fi + + distrobox-host-exec "${@}" +} +if [ -n "${ZSH_VERSION-}" ]; then + command_not_found_handler() { + command_not_found_handle "$@" + } +fi -- cgit v1.2.3