Create command dispatching classes
This commit is contained in:
12
packages/sshecret-sshd/src/sshecret_sshd/commands/utils.py
Normal file
12
packages/sshecret-sshd/src/sshecret_sshd/commands/utils.py
Normal file
@ -0,0 +1,12 @@
|
||||
"""Various utilities."""
|
||||
|
||||
import asyncssh
|
||||
from rich.console import Console
|
||||
|
||||
def get_console(process: asyncssh.SSHServerProcess[str]) -> Console:
|
||||
"""Initiate console from process."""
|
||||
_width, _height, pixwidth, pixheight = process.term_size
|
||||
console = Console(
|
||||
force_terminal=True, width=pixwidth, height=pixheight, color_system="standard"
|
||||
)
|
||||
return console
|
||||
Reference in New Issue
Block a user