mirror of https://github.com/liamg/aminal.git
Correct handling of DeviceAttributes request (#139)
This commit is contained in:
parent
89eea0921d
commit
c674cbd5c7
|
@ -108,12 +108,28 @@ func csiHandler(pty chan rune, terminal *Terminal) error {
|
|||
|
||||
func csiSendDeviceAttributesHandler(params []string, intermediate string, terminal *Terminal) error {
|
||||
|
||||
if len(params) > 0 && len(params[0]) > 0 && params[0][0] == '>' { // secondary
|
||||
_ = terminal.Write([]byte("\x1b[0;0;0c")) // report VT100
|
||||
return nil
|
||||
// we are VT100
|
||||
// for DA1 we'll respond 1;2
|
||||
// for DA2 we'll respond 0;0;0
|
||||
|
||||
response := "1;2"
|
||||
|
||||
if len(params) > 0 {
|
||||
param, err := strconv.Atoi(params[0])
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("Invalid parameter in DA request: %s", params[0])
|
||||
}
|
||||
|
||||
return fmt.Errorf("Unsupported SDA identifier")
|
||||
if param > 0 {
|
||||
// DA2
|
||||
response = "0;0;0"
|
||||
}
|
||||
}
|
||||
|
||||
_ = terminal.Write([]byte("\x1b[?" + response + "c"))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func csiDeviceStatusReportHandler(params []string, intermediate string, terminal *Terminal) error {
|
||||
|
|
Loading…
Reference in New Issue