mirror of https://github.com/liamg/aminal.git
Clear selection on "reset mode" sequence (#172)
This commit is contained in:
parent
04bcd68a1c
commit
3ea8a70874
|
@ -282,6 +282,14 @@ func (buffer *Buffer) EndSelection(col uint16, viewRow uint16, complete bool) {
|
|||
}
|
||||
}
|
||||
|
||||
func (buffer *Buffer) ClearSelection() {
|
||||
buffer.selectionStart = nil
|
||||
buffer.selectionEnd = nil
|
||||
buffer.selectionComplete = true
|
||||
|
||||
buffer.emitDisplayChange()
|
||||
}
|
||||
|
||||
func (buffer *Buffer) InSelection(col uint16, row uint16) bool {
|
||||
|
||||
if buffer.selectionStart == nil || buffer.selectionEnd == nil {
|
||||
|
|
|
@ -422,6 +422,7 @@ func csiEraseCharactersHandler(params []string, terminal *Terminal) error {
|
|||
}
|
||||
|
||||
func csiResetModeHandler(params []string, terminal *Terminal) error {
|
||||
terminal.ActiveBuffer().ClearSelection()
|
||||
return csiSetMode(strings.Join(params, ""), false, terminal)
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ func New(pty platform.Pty, logger *zap.SugaredLogger, config *config.Config) *Te
|
|||
},
|
||||
platformDependentSettings: pty.GetPlatformDependentSettings(),
|
||||
}
|
||||
t.activeBuffer = t.buffers[0]
|
||||
t.activeBuffer = t.buffers[MainBuffer]
|
||||
return t
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue