I would like to know if there is a way to know if DECCKM function (specifying whether or not to use ANSI cursor sequences) has been set or not.
I'm connecting to a process via ptrace so I have no way to know if the sequences ^[[?1h or ^[[?1l have been sent to the terminal before making the connection.
Is there some string sequence that, when sent to the terminal, will allow me to query the state of Cursor Keys Mode? Or is there some C function/syscall that can do it? As I'm debugging the process I can fake both terminal input and call system functions on behalf of the debugged process so I'm just interested in knowing how can you perform the check as if you were writing the program and had access to the source code.
Use DECRQM to inquire status of DECCKM.