]> git.ipfire.org Git - thirdparty/systemd.git/commit
terminal-util: when prompting for a choice from a list, preselect longest prefix
authorLennart Poettering <lennart@amutable.com>
Tue, 5 May 2026 08:45:14 +0000 (10:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 May 2026 15:47:20 +0000 (17:47 +0200)
commitfc05165fce386c8cf991f18abecc5098e7261b6f
tree85a4a56a1379575b404e9432bdadce3b39fb64e9
parentc0aa351ba966bb89bab11673cae72ccba2e16bc4
terminal-util: when prompting for a choice from a list, preselect longest prefix

If all entries of a menu prompt start with the same prefix, let's
preselect the prefix to enhance user experience.

This is particularly relevant when prompting for a disk to install
things on, as typically they all start with the same prefix /dev/, and
if there's only a single target medium discoverable, then we can even
fill it out fully.
src/basic/terminal-util.c
src/basic/terminal-util.h
src/home/homectl.c
src/shared/prompt-util.c