HOW TO - Set insert as the default in ALL applications, not just on the command line? #677
-
The default in the command line with clink is "insert mode" (vs. overwrite). However, in CLI applications (notably SQLITE3) the default is OVERWRITE which is super annoying. In the old version (0.4.9) I had it set so insert was always the default in every app and the command line. How do I do this in the new version? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Clearing up some misunderstandings:
The default default in Windows consoles is "insert mode". I say "default default" because in LNK files you can override the default in the console session started from the LNK file, resulting in a per-console custom default.
CLI applications start out by inheriting the current mode. Clink cannot prevent CLI applications from calling SetConsoleMode and forcing the OS to use "insert mode" or "overwrite mode".
Clink v0.4.9 always saves the current console mode before letting you edit the input line, and then restores the console mode to the saved mode after you finish editing the input line: refer to the source code here. So, no, you didn't configure Clink 0.4.9 to force every app to use insert mode. That isn't possible. Ok then what is it?I don't know what's doing it. But it's not Clink, and never was. It could be that SQLite is doing it. You could examine the source code for how it uses SetConsoleMode. It could be that the console you're using is configured to use overwrite mode by default. LNK files have a setting in the Properties | Options page that controls whether the console starts out in "insert mode". Note If you open the Properties page for an already-running console, then it shows the current options, not the startup options. So if you open the Properties page in an already-running console while it's waiting for an input line, then that won't reveal what the mode was before Clink intercepted the input line read request. To find the console's current input mode outside of Clink, you would need to open the Properties page while Clink is not accepting an input line. One way to accomplish that could be to run |
Beta Was this translation helpful? Give feedback.
Clearing up some misunderstandings:
The default default in Windows consoles is "insert mode".
I say "default default" because in LNK files you can override the default in the console session started from the LNK file, resulting in a per-console custom default.
CLI applications start out by inheriting the current mode.
But they can call SetConsoleMode to set the mode to use "insert mode" or "overwrite mode".
Clink cannot prevent CLI applications from calling SetConsoleMode and forcing the OS to use "insert mode" or…