Skip to content

Fix file autocompletion bugs and restore cycling#2100

Merged
jubalh merged 1 commit intomasterfrom
fix/2098
Mar 1, 2026
Merged

Fix file autocompletion bugs and restore cycling#2100
jubalh merged 1 commit intomasterfrom
fix/2098

Conversation

@jubalh
Copy link
Copy Markdown
Member

@jubalh jubalh commented Feb 28, 2026

Fix #2098

@jubalh jubalh added this to the next milestone Feb 28, 2026
@jubalh jubalh self-assigned this Feb 28, 2026
@jubalh
Copy link
Copy Markdown
Member Author

jubalh commented Feb 28, 2026

@mdosch

@jubalh jubalh marked this pull request as draft February 28, 2026 15:05
@jubalh
Copy link
Copy Markdown
Member Author

jubalh commented Feb 28, 2026

I'll need to go now. I'll continue later.

@jubalh jubalh marked this pull request as ready for review February 28, 2026 23:57
@jubalh jubalh changed the title fix: Double free and memory leak in filepath completion Fix file autocompletion bugs and restore cycling Feb 28, 2026
@jubalh jubalh force-pushed the fix/2098 branch 2 times, most recently from def2b85 to 33bb007 Compare March 1, 2026 00:15
Fix several issues in cmd_ac_complete_filepath:
* Prevent a segfault when input is empty.
* Fix a double free where acstring was managed by both auto_gchar and GArray.
* Fix a memory leak when reassigning inpcp during quote stripping.
* Restore the ability to cycle through files on repeated TAB presses by
  caching the last input and skipping updates if the input is already a
  known completion.
* Preserve user input style (e.g. ~, ./) in autocompletion strings to
  ensure matches are correctly displayed and filtered.

Bug got introduced when "cleaning" code with new compiler flags and
sanitizers: aec8e48.
Add unit tests so this doesn't happen again.

Before that commit we didn't use the static variable but used
autocomplete_update instead. Now we avoid redundat updates and preserve
the state across tab presses. We should look at this again later.

Fix #2098
@jubalh jubalh merged commit 7088c2c into master Mar 1, 2026
7 checks passed
@jubalh jubalh deleted the fix/2098 branch March 1, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autocomplete path for sendfile causes SIGABRT

1 participant