On the recent development build 3156 of Sublime Text, there was this fix:
Reinvoking the Command Palette while it is open, but without focus, now works properly
However, that bug was the only way I have to close the command palette without erasing my initial text: Core$1814. On build 3155, If I called the command palette command again, when it was without focus, then it does not deleted my inputted text.
Now, I wrote a plugin (fixed_command_palette_input_history.py) which runs as series of commands like:
...
self.window.run_command( "show_overlay", {"overlay": "command_palette"} )
self.window.run_command( "select_all" )
self.window.run_command( "copy" )
current_clipboard_text = sublime.get_clipboard()
...
sublime.set_clipboard( clipboard_text )
self.window.run_command( "paste" )
self.window.run_command( "select_all" )
Then it was able to fix the issue Core$1814, however now I loose the clipboard text I had before opening the command palette, as it is replaced by the text I copied from the command palette input widget.
I am thinking about saving and restoring it before running these commands, however is there another way I can copy the contents of the Command Palette
other than:
self.window.run_command( "select_all" )
self.window.run_command( "copy" )