Skip to content

Commit

Permalink
Bracketed paste sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
knz committed Aug 14, 2022
1 parent 0899c83 commit b246687
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions screen.go
Expand Up @@ -49,6 +49,13 @@ const (
AltScreenSeq = "?1049h"
ExitAltScreenSeq = "?1049l"

// Bracketed paste.
// https://en.wikipedia.org/wiki/Bracketed-paste
EnableBracketedPasteSeq = "?2004h"
DisableBracketedPasteSeq = "?2004l"
StartBracketedPasteSeq = "200~"
EndBracketedPasteSeq = "201~"

// Session.
SetWindowTitleSeq = "2;%s\007"
SetForegroundColorSeq = "10;%s\007"
Expand Down Expand Up @@ -256,3 +263,13 @@ func DisableMouseAllMotion() {
func SetWindowTitle(title string) {
fmt.Printf(OSC+SetWindowTitleSeq, title)
}

// EnableBracketedPaste enables bracketed paste.
func EnableBracketedPaste() {
fmt.Print(CSI + EnableBracketedPasteSeq)
}

// DisableBracketedPaste disables bracketed paste.
func DisableBracketedPaste() {
fmt.Print(CSI + DisableBracketedPasteSeq)
}

0 comments on commit b246687

Please sign in to comment.