Skip to content

Commit

Permalink
feat(ansi): xterm: modifyotherkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Aug 14, 2024
1 parent a29dab6 commit 64f64bd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ansi/xterm.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
package ansi

import "strconv"

// ModifyOtherKeys returns a sequence that sets XTerm modifyOtherKeys mode.
// The mode argument specifies the mode to set.
//
// 0: Disable modifyOtherKeys mode.
// 1: Enable modifyOtherKeys mode 1.
// 2: Enable modifyOtherKeys mode 2.
//
// CSI > 4 ; mode m
//
// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_
// See: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys
func ModifyOtherKeys(mode int) string {
return "\x1b[>4;" + strconv.Itoa(mode) + "m"
}

// DisableModifyOtherKeys disables the modifyOtherKeys mode.
//
// CSI > 4 ; 0 m
Expand Down

0 comments on commit 64f64bd

Please sign in to comment.