[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Receiving and setting TERM env
[Thread Prev] | [Thread Next]
- Subject: Re: Receiving and setting TERM env
- From: Jakub Jelen <jjelen@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Fri, 14 Apr 2023 14:36:21 +0200
- To: libssh@xxxxxxxxxx
On 4/13/23 21:37, Jose David Bravo A wrote:
Hello, I implemented an SSH server using the example in ssh_server.c as a base. In the exec_pty function, I'm executing another program that uses ncurses.I believe I need to pass the client's TERM environment variable to the PTY allocated to that client so that the ncurses program knows how to display itself properly. Am I correct?How can I receive the TERM environment variable sent by the client and set it in the allocated PTY?
Correct. As you can see in the SSH specification, the TERM environment variable is passed as part of the SSH_MSG_CHANNEL_REQUEST of type "pty-req" so in your code you should find it in your ssh_message structure when you handle this message under msg->channel_request.TERM.
https://www.rfc-editor.org/rfc/rfc4254#section-6.2 Regards, -- Jakub Jelen Crypto Team, Security Engineering Red Hat, Inc.
Re: Receiving and setting TERM env | Jose David Bravo A <jbravo@xxxxxxxxxxxxxxxxxxxxxx> |
Receiving and setting TERM env | Jose David Bravo A <jbravo@xxxxxxxxxxxxxxxxxxxxxx> |