fix: allow multiple `bindCLIShortcuts` calls with shortcut merging #21103
Openedmundhung wants to merge 2 commits into main from edmundhung/main· opened yesterday
+103−3
edmundhung commented yesterdayAuthor
Fixes #15781.
Closes #15881.
This fixes an issue where calling bindCLIShortcuts() multiple times would create duplicate readline
instances and lose custom shortcuts from previous calls. This is useful for plugins adding their own
shortcuts while Vite CLI continues to print the help message.
Now when you bind shortcuts multiple times, they are properly merged, with new custom shortcuts taking
priority:
Fixes #15781. Closes #15881.
This fixes an issue where calling
bindCLIShortcuts()multiple times would create duplicate readline instances and lose custom shortcuts from previous calls. This is useful for plugins adding their own shortcuts while Vite CLI continues to print the help message.Now when you bind shortcuts multiple times, they are properly merged, with new custom shortcuts taking priority:
This works for both dev and preview server.