mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Fix stdin recording (broken during pty refactor)
This commit is contained in:
@@ -74,9 +74,10 @@ def record(
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
while data:
|
remaining_data = data
|
||||||
n = os.write(pty_fd, data)
|
while remaining_data:
|
||||||
data = data[n:]
|
n = os.write(pty_fd, remaining_data)
|
||||||
|
remaining_data = remaining_data[n:]
|
||||||
|
|
||||||
if not pause_time:
|
if not pause_time:
|
||||||
assert start_time is not None
|
assert start_time is not None
|
||||||
|
|||||||
@@ -82,7 +82,10 @@ bash -c "sleep 1; pkill -9 -n -f 'bash -c echo t3st'" &
|
|||||||
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' "${TMP_DATA_DIR}/4.cast"
|
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' "${TMP_DATA_DIR}/4.cast"
|
||||||
|
|
||||||
# with stdin recording
|
# with stdin recording
|
||||||
asciinema rec --stdin -c 'bash -c "echo t3st; sleep 1; echo ok"' "${TMP_DATA_DIR}/5.cast"
|
echo "ls" | asciinema rec --stdin -c 'bash -c "sleep 1"' "${TMP_DATA_DIR}/5.cast"
|
||||||
|
cat "${TMP_DATA_DIR}/5.cast"
|
||||||
|
grep '"i", "ls\\n"' "${TMP_DATA_DIR}/5.cast"
|
||||||
|
grep '"o",' "${TMP_DATA_DIR}/5.cast"
|
||||||
|
|
||||||
# raw output recording
|
# raw output recording
|
||||||
asciinema rec --raw -c 'bash -c "echo t3st; sleep 1; echo ok"' "${TMP_DATA_DIR}/6.raw"
|
asciinema rec --raw -c 'bash -c "echo t3st; sleep 1; echo ok"' "${TMP_DATA_DIR}/6.raw"
|
||||||
|
|||||||
Reference in New Issue
Block a user