You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.onData() appears to not give the last batch of output from the process. I've only been able to recreate the issue on NixOS.
Below is an example of trying to run ls -l /etc but as you can see the output is cut off half way through the line. I've tried commands other ls and I get similar results. I've tried both the latest and beta versions of node-pty and I get the same behaviour. I've also tried multiple Node.js versions, 18, 20, 21 and I get the same result. Re-running the node -e 'require(... command often cuts off the output in different places.
/tmp/tmp.ivJDE6RJN4 is 📦 v1.0.0 via v20.11.1
❯ node -e 'require("node-pty").spawn("ls", [ "-l" , "/etc" ], {}).onData(console.log)'
total 180
-rw-r--r-- 1 root root 44 Mar 14 15:34 adjtime
drwxr-xr-x 3 root root 4096 Feb 6 14:10 alsa
drwxr-xr-x 3 root root 4096 Feb 12 16:04 avahi
lrwxrwxrwx 1 root root 18 Mar 14 15:36 bashrc -> /etc/static/bashrc
drwxr-xr-x 2 root root 4096 Mar 14 15:36 binfmt.d
lrwxrwxrwx 1 root root 16 Mar 14 15:36 cups -> /etc/static/cups
lrwxrwxrwx 1 root root 18 Mar 14 15:36 dbus-1 -> /etc/static/dbus-1
drwxr-xr-x 2 root root 4096 Mar 14 15:36 default
drwxr-xr-x 3 root root 4096 Mar 14 15:36 direnv
drwxr-xr-x 2 root root 4096 Mar 14 15:36 egl
lrwxrwxrwx 1 root root 17 Mar 14 15:36 fonts -> /etc/static/fonts
lrwxrwxrwx 1 root root 17 Mar 14 15:36 fstab -> /etc/static/fstab
lrwxrwxrwx 1 root root 21 Mar 14 15:36 fuse.conf -> /etc/static/fuse.conf
lrwxrwxrwx 1 root root 21 Mar 14 15:36 gitconfig -> /etc/static/gitconfig
drwxr-xr-x 2 root root 4096 Feb 8 13:52 gnupg
-rw-r--r-- 1 root root 925 Mar 14 15:36 group
lrwxrwxrwx 1 root root 21 Mar 14 15:36 host.conf -> /etc/static/host.conf
lrwxrwxrwx 1 root root 20 Mar 14 15:36 hostname -> /etc/static/hostname
lrwxrwxrwx 1 root root 17 Mar 14 15:36 hosts -> /etc/static/hosts
lrwxrwxrwx 1 root root 19 Mar 14 15:36 inputrc -> /etc/static/inputrc
drwx------ 2 root root 4096 Feb 6 14:10 ipsec.d
lrwxrwxrwx 1 root root 17 Mar 14 15:36 issue -> /etc/static/issue
lrwxrwxrwx 1 root root 15 Mar 14 15:36 kbd -> /etc/static/kbd
drwxr-xr-x 3 root root 4096 Feb 6 14:10 libblockdev
lrwxrwxrwx 1 root root 23 Mar 14 15:36 locale.conf -> /etc/static/locale.conf
lrwxrwxrwx 1 root root 27 Mar 14 15:36 localtime -> /etc/zoneinfo/Europe/London
lrwxrwxrwx 1 root root 22 Mar 14 15:36 login.defs -> /etc/static/login.defs
lrwxrwxrwx 1 root root 23 Mar 14 15:36 lsb-release -> /etc/static/lsb-release
drwxr-xr-x 2 root root 4096 Mar 14 15:36 lvm
-r--r--r-- 1 root root 33 Feb 6 14:10 machine-id
lrwxrwxrwx 1 root root 23 Mar 14 15:36 man_db.conf -> /etc/static/man_db.conf
drwxr-xr-x 2 root root 4096 Mar 14 15:36 modprobe.d
drwxr-xr-x 2 root root 4096 Mar 14 15:36 modules-load.d
lrwxrwxrwx 1 root root 14 Mar 14 15:36 mtab -> ../proc/mounts
lrwxrwxrwx 1 root root 18 Mar 14 15:36 nanorc -> /etc/static/nanorc
lrwxrwxrwx 1 root root 20 Mar 14 15:36 netgroup -> /etc/static/netgroup
drwxr-xr-x 4 root root 4096 Mar 14 15:36 NetworkManager
drwxr-xr-x 2 root root 4096 Mar 14 15:36 nix
drwxr-xr-x 2 root root 4096 Feb 6 14:01 nixos
-rw-r--r-- 1 root root 0 Feb 6 14:10 NIXOS
lrwxrwxrwx 1 root root 21 Mar 14 15:36 nscd.conf -> /etc/static/nscd.conf
lrwxrwxrwx 1 root root 25 Mar 14 15:36 nsswitch.conf -> /etc/static/nsswitch.conf
drwxr-xr-x 2 root root 4096 Mar 14 15:36 nvidia
lrwxrwxrwx 1 root root 22 Mar 14 15:36 os-release -> /etc/static/os-release
drwxr-xr-x 2 root root 4096 Mar 14 15:36 pam
drwxr-xr-x 2 root root 4096 Mar 14 15:36 pam.d
-rw-r--r-- 1 root root 4357 Mar 14 15:36 passwd
-rw-r--r-- 1 root root 4086 Feb 6 14:10 passwd-
drwxr-xr-x 3 root root 4096 Feb 6 14:10 pki
drwxr-xr-x 3 root root 4096 Feb 6 14:10 polkit-1
-rw-r--r-- 1 root root 239 Feb 12 16:54 printcap
lrwxrwxrwx 1 root root 19 Mar 14 15:36 profile -> /etc/static/profile
drwxr-xr-x 3 root root 4096 Feb 6 14:10 profiles
lrwxrwxrwx 1 root root 21 Mar 14 15:36 protocols -> /etc/static/protocols
drwxr-xr-x 2 root root 4096 Mar 14 15:36 pulse
-rw-r--r-- 1 root root 117 Mar 14 15:36 resolv.conf
-rw-r--r-- 1 root root 0 Feb 6 13:17 resolv.conf.bak
lrwxrwxrwx 1 root root 27 Mar 14 15:36 resolvconf.conf -> /etc/static/resolvconf.conf
lrwxrwxrwx 1 root root 15 Mar 14 15:36 rpc -> /etc/static/rpc
drwxr-xr-x 2 root root 4096 Mar 14 15:36 samba
lrwxrwxrwx 1 root root 21 Mar 14 15:36 sddm.conf -> /etc/static/sddm.conf
lrwxrwxrwx 1 root root 20 Mar 14 15:36 services -> /etc/static/services
lrwxrwxrwx 1 root root 27 Mar 14 15:36 set-environment -> /etc/static/set-environment
-rw-r----- 1 root shadow 1218 Mar 14 15:
/tmp/tmp.ivJDE6RJN4 is 📦 v1.0.0 via v20.11.1
❯
The text was updated successfully, but these errors were encountered:
Environment details
Issue description
.onData()
appears to not give the last batch of output from the process. I've only been able to recreate the issue on NixOS.Below is an example of trying to run
ls -l /etc
but as you can see the output is cut off half way through the line. I've tried commands otherls
and I get similar results. I've tried both the latest and beta versions ofnode-pty
and I get the same behaviour. I've also tried multiple Node.js versions, 18, 20, 21 and I get the same result. Re-running thenode -e 'require(...
command often cuts off the output in different places.The text was updated successfully, but these errors were encountered: