Fix line-wise autosuggestion false positive when line doesn't start command

To reduce the likelihood of false positive line-wise history
autosuggestions, we only them when the cursor's line starts a new
process ("parse_util_process_extent").

There are still false positives. Given

	$ true &&
          somecommand
	$ echo "
	someothercommand
	"

typing "some" suggests "someothercommand" from history even though
that was not actually used as command.

Fix this by using similar rules for suggestion candidates.

Might help #12290
This commit is contained in:
Johannes Altmanninger
2026-01-10 10:50:54 +01:00
parent 739b82c34d
commit 58e7a50de8
4 changed files with 61 additions and 27 deletions

View File

@@ -80,3 +80,11 @@ run("rm configure")
send("./con")
use_suggestion()
expect_prompt(">./con\r\n")
send(control("c"))
run("touch somecommand")
run("chmod +x somecommand")
run('echo "multiline-token\n./somecommand arg1 arg2"')
send("./some")
use_suggestion()
expect_prompt(">./somecommand \r\n")