gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
537 stars 100 forks source link

Allow `podman exec` with `--interactive` and no `--tty` #583

Closed jhc4318 closed 3 months ago

jhc4318 commented 4 months ago

An interactive container does not need to have a TTY. There's a slight difference in behaviour that is currently a blocker for my use case.

>podman exec -i ctr_name /bin/bash -c 'hi' 1> 1.txt 2> 2.txt
>cat 1.txt
>cat 2.txt
/bin/bash: hi: command not found

>podman exec -it ctr_name /bin/bash -c 'hi' 1> 1.txt 2> 2.txt
>cat 1.txt 
/bin/bash: hi: command not found
>cat 2.txt 

I've added a testcase for the --interactive only case however stdout/stderr isn't captured by PoW in the -it case so no test has been added there (this also does not affect the existing behaviour there anyway).