2fc4a371fe36b1edcaa2f555878644bda772acdb went someway towards this, but there are still issues. Namely `pw-cli` reads EOF from /dev/tty if it's in a pipeline or subshell.