From 1a76e3e69c43ae60126d4ebdbde3ca5c555c25b9 Mon Sep 17 00:00:00 2001 From: Christian Goeschel Ndjomouo Date: Wed, 27 Aug 2025 23:26:42 -0400 Subject: [PATCH] bash-completion: add fallback to filename expansion for umount If the user defined path can not be found in the mount table fallback to simple filename expansion. Addresses: #1333 Signed-off-by: Christian Goeschel Ndjomouo --- bash-completion/umount | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bash-completion/umount b/bash-completion/umount index 35e86d909..9ea126bac 100644 --- a/bash-completion/umount +++ b/bash-completion/umount @@ -83,7 +83,13 @@ _umount_module() ;; esac - local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( _umount_points_list )' -- "$cur" ) ) + if command grep -q "^$cur" <(findmnt -lno TARGET); then + local IFS=$'\n' + COMPREPLY=( $( compgen -W '$( _umount_points_list )' -- "$cur" ) ) + else + compopt -o filenames + COMPREPLY=( $(compgen -o dirnames -- "$cur") ) + return 0 + fi } complete -F _umount_module -o nospace umount -- 2.47.3