.
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 21s

This commit is contained in:
Your Name 2025-05-10 13:28:13 +12:00
parent 4087b6e596
commit 00571d8091
2 changed files with 34 additions and 8 deletions

20
runner/jt.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# JSON=$(cat <<'EOF'
# {"command":"nano","args":["-w","./hello.txt"]}
# EOF
# )
JSON=$(cat <<'EOF'
{"command":"nano","args":["-w","./hello.txt"],"ssh":{"host":"localhost","user":"j","key":"auto"},"options":{"interactive":true},"env":{"TERM":"xterm-256color"}}
EOF
)
BASE64=$(echo -n "$JSON" | base64 -w0)
echo "JSON: $JSON"
echo "Running command..."
build/runner "$BASE64"

View File

@ -424,15 +424,21 @@ int Runner::execute_ssh(
}
if (interactive) {
// Request a pseudo-terminal for interactive commands
rc = ssh_channel_request_pty(channel);
// Request a pseudo-terminal for interactive commands with specific term type
const char* term_type = "xterm-256color";
rc = ssh_channel_request_pty_size(channel, term_type, 80, 24);
if (rc != SSH_OK) {
std::cerr << "Error requesting PTY: " << ssh_get_error(session) << std::endl;
ssh_channel_close(channel);
ssh_channel_free(channel);
ssh_disconnect(session);
ssh_free(session);
return -1;
// Fallback to basic PTY request
std::cerr << "Warning: Could not set PTY with size, falling back to basic PTY" << std::endl;
rc = ssh_channel_request_pty(channel);
if (rc != SSH_OK) {
std::cerr << "Error requesting PTY: " << ssh_get_error(session) << std::endl;
ssh_channel_close(channel);
ssh_channel_free(channel);
ssh_disconnect(session);
ssh_free(session);
return -1;
}
}
}