Skip to content

Add gnome-terminal as terminal emulator #264

@tcaiazzi

Description

@tcaiazzi

We need to add specific support to gnome-terminal as terminal emulator.

def unix_connect() -> None:
if terminal == "TMUX":
from ...trdparty.libtmux.tmux import TMUX
logging.debug("Attaching `%s` to TMUX session `%s` with command `%s`" % (machine.name, machine.lab.name,
connect_command))
TMUX.get_instance().add_window(
machine.lab.name,
machine.name,
connect_command,
cwd=machine.lab.fs_path()
)
else:
logging.debug("Opening Linux terminal with command: %s." % connect_command)
# Command should be passed as an array
# https://stackoverflow.com/questions/9935151/popen-error-errno-2-no-such-file-or-directory/9935511
subprocess.Popen([terminal, "-e", connect_command],
cwd=machine.lab.fs_path(),
start_new_session=True
)

Indeed, in the unix_connect function, the -e option we use to pass the connect_command to the terminal will be deprecated for gnome-terminal in the future.
We need to use -- to terminate the options and put the connect_command to execute after it.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions