[9.x] Improves output capture from serve
command
#43461
+41
−18
Merged