From 69053d96239e5ef1f97522949d8c712fa5846eab Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 19 Jul 2022 13:55:50 +0200 Subject: [PATCH] Use menu behavior when completing change-directory This makes "cd" change to the first completion, not to $HOME. This might be surprising but it should make sense. I don't have a concrete motivation but this should save a Tab press in some scenarios. --- src/commands.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 199d2d92..a854ea33 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -2555,7 +2555,8 @@ const CommandDesc change_directory_cmd = { return { 0_byte, cursor_pos, complete_filename(prefix, context.options()["ignored_files"].get(), - cursor_pos, FilenameFlags::OnlyDirectories) }; + cursor_pos, FilenameFlags::OnlyDirectories), + Completions::Flags::Menu }; }), [](const ParametersParser& parser, Context&, const ShellContext&) {