Terminal handling in GO

I have this docker client software that I’m building using docker’s SDK, but am running in multiple issues with my version of docker exec (my tool is named dtools, so… : dtools exec.

Whenever I run dtools exec [flags] $container bash, this happens:

  • stdin is also sent to stdout after I press enter
  • CTRL+C exits the container instead of going back to a prompt within the shell in the container
  • TAB does not work

The code is at GitHub - jeanfrancoisgratton/dtools at exec_run, specifically under src/container/exec.go

Any ideas on how to properly run this ?

Basically, I’d need guidance on the above in a context of running a docker exec -ti look-alike. My tool is near-completion, except for docker volume handling (not coded yet), and docker push not working (WIP). See MAPPINGS.md for a kind of compatibility grid between docker and dtools.