about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/zpty.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 2408be797..d25c3a865 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -483,7 +483,12 @@ ptyread(char *nam, Ptycmd cmd, char **args)
 	    if (cmd->fin)
 		break;
 	}
-	if ((ret = read(cmd->fd, buf + used, 1)) == 1) {
+	if (cmd->read != -1 || (ret = read(cmd->fd, buf + used, 1)) == 1) {
+	    if (cmd->read != -1) {
+		ret = 1;
+		buf[used] = (char) cmd->read;
+		cmd->read = -1;
+	    }
 	    seen = 1;
 	    if (++used == blen) {
 		if (!*args) {