Skip to content

Commit eb53990

Browse files
committed
settings: Change default of paste to true for Windows Terminal App
1 parent df3473d commit eb53990

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

internal/config/settings.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var DefaultGlobalOnlySettings = map[string]any{
123123
"mouse": true,
124124
"multiopen": "tab",
125125
"parsecursor": false,
126-
"paste": false,
126+
"paste": defaultPaste(),
127127
"pluginchannels": []string{"https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json"},
128128
"pluginrepos": []string{},
129129
"savehistory": true,
@@ -462,6 +462,16 @@ func defaultFakeCursor() bool {
462462
return false
463463
}
464464

465+
func defaultPaste() bool {
466+
_, wt := os.LookupEnv("WT_SESSION")
467+
if runtime.GOOS == "windows" && wt {
468+
// enabled for windows terminal app where the default paste bindings
469+
// like Ctrl-v and Ctrl-Shift-v produce bracketed paste
470+
return true
471+
}
472+
return false
473+
}
474+
465475
func GetInfoBarOffset() int {
466476
offset := 0
467477
if GetGlobalOption("infobar").(bool) {

runtime/help/options.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ Here are the available options:
306306
keybinding) then it is a good idea to enable this option during the paste
307307
and disable once the paste is over. See `> help copypaste` for details about
308308
copying and pasting in a terminal environment.
309+
Note: This option defaults to `true` in case `micro` is used in the Windows
310+
Terminal App.
309311

310312
default value: `false`
311313

0 commit comments

Comments
 (0)