In order to be able to use mactelnet from PHP (and so without terminal), terminal size should be specified.
Here is a patch i propose.
diff --git a/src/mactelnet.c b/src/mactelnet.c
index 8358673..ce2db40 100644
--- a/src/mactelnet.c
+++ b/src/mactelnet.c
@@ -247,6 +247,11 @@ static void send_auth(char *username, char *password) {
height = htole16(height);
plen += add_control_packet(&data, MT_CPTYPE_TERM_WIDTH, &width, 2);
plen += add_control_packet(&data, MT_CPTYPE_TERM_HEIGHT, &height, 2);
+ } else {
+ width = htole16(0);
+ height = htole16(0);
+ plen += add_control_packet(&data, MT_CPTYPE_TERM_WIDTH, &width, 2);
+ plen += add_control_packet(&data, MT_CPTYPE_TERM_HEIGHT, &height, 2);
}
outcounter += plen;
If you don't, you get disconnected and so the program is no more usable from PHP (or any non TTY environment).