How to use python to implement a xshell (terminal) of your own, which can be run under Mac

because I can"t find a tool like xshell that I am satisfied with under Mac (can remember the password, send commands to multiple nodes at the same time, and save the connection list), I just want to write one myself and give me some inspiration?
mainly does not know how to draw the dark box, and how to display the results returned by the command into the dark box.

Apr.01,2021

Coincidentally, there was a similar requirement a few days ago, but instead of writing a terminal, I simply wrote down to get a command line to enter commands freely, and the commands entered are not isolated. The code is as follows for your reference. As for writing terminals, you may need to add a lot of things, which can not be easily done. It is suggested that secureCRT for mac I am using the representation

.
import paramiko
import time

ip = "10.211.55.6"
port = 22
username = "root"
password = "redhat"


def recv_str(client_channel, tag_str=None):
    result = client_channel.recv(65535).decode()
    while not result.endswith(tag_str):
        result = result + client_channel.recv(65535).decode()
    return result


client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=ip, port=port, username=username, password=password,
               timeout=60)
channel = client.invoke_shell()
channel.send("ping www.baidu.com\n")
time.sleep(2)
channel.send(chr(3))
res = recv_str(channel, "[root@centos-linux ~]-sharp ")
print(res)
client.close()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b412b1-2bcea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b412b1-2bcea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?