Pio debug: cursor keys not working in gdb

Hi,
I tried to debug my application by using

pio debug --interface=gdb

but cursor keys (history) seems not working in gdb, i just get eg ^[[A instead of the Up Key.

I use
PlatformIO Core, version 6.1.18, Pyhon 3.11.2 in debian 12.5, but all in a docker container. But the container seems not the issue. I can see that gdb is spawned and I can issue the same command and keys are working. I tried “show history size” in gdb and both times got result 256. I think pio connects to gdb by sockets, so there might be an issue there?