mirror of https://github.com/liamg/aminal.git
commit
03edabd918
|
@ -644,7 +644,7 @@ func (buffer *Buffer) CarriageReturn() {
|
||||||
func (buffer *Buffer) Tab() {
|
func (buffer *Buffer) Tab() {
|
||||||
defer buffer.emitDisplayChange()
|
defer buffer.emitDisplayChange()
|
||||||
tabSize := 4
|
tabSize := 4
|
||||||
shift := int(buffer.cursorX) % tabSize
|
shift := int(buffer.cursorX-1) % tabSize
|
||||||
if shift == 0 {
|
if shift == 0 {
|
||||||
shift = tabSize
|
shift = tabSize
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,11 +26,15 @@ var escapeSequenceMap = map[rune]escapeSequenceHandler{
|
||||||
}
|
}
|
||||||
|
|
||||||
func newLineSequenceHandler(pty chan rune, terminal *Terminal) error {
|
func newLineSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||||
terminal.logger.Debugf("New line!")
|
|
||||||
terminal.ActiveBuffer().NewLine()
|
terminal.ActiveBuffer().NewLine()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func tabSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||||
|
terminal.ActiveBuffer().Tab()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func carriageReturnSequenceHandler(pty chan rune, terminal *Terminal) error {
|
func carriageReturnSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||||
terminal.ActiveBuffer().CarriageReturn()
|
terminal.ActiveBuffer().CarriageReturn()
|
||||||
return nil
|
return nil
|
||||||
|
@ -61,11 +65,6 @@ func shiftInSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func tabSequenceHandler(pty chan rune, terminal *Terminal) error {
|
|
||||||
terminal.logger.Errorf("Received tab")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (terminal *Terminal) processInput(ctx context.Context, pty chan rune) {
|
func (terminal *Terminal) processInput(ctx context.Context, pty chan rune) {
|
||||||
|
|
||||||
// https://en.wikipedia.org/wiki/ANSI_escape_code
|
// https://en.wikipedia.org/wiki/ANSI_escape_code
|
||||||
|
|
Loading…
Reference in New Issue