I'm confident that I can figure out the signal handling with the interface presented by the package and experimentation, but the control code problem really has me stumped.
I've put up a detailed question on Stack Overflow outlining my problem including the sample code from my program (basically cookie-cutter crypto/ssh usage): http://stackoverflow.com/questions/28921409/how-can-i-send-terminal-escape-sequences-through-ssh-with-go
Basically: I drop a shell by creating a Session whose stdin, stderr and stdout are that of my main process, call RequestPty(), Shell() and Wait(). The shell works well enough, but if the user presses (for example) left arrow, I see the escape code for it show up in the console (^[[A).
Someone in #golang-nuts quite helpfully suggested that I re-read The TTY Demystified, which I did, but I still can't figure out what is going on or how to prevent it.
The crypto/ssh/terminal package looks like it should be important for solving my problem, but I can't actually see how.
I'm not even sure precisely whether #golang-nuts is the write place to ask this question, but there's a simple reason why I need to solve it in terms of Go: if I was working in various other languages, I can't experiment with how a fork() would affect with the signal and TTY handling.
I can't solve the (hopefully simpler) problems with signal handling until this is sorted out, because when I hit ^c I can't tell whether the acknowledgement of it is being printed by my terminal or the one on the remote host.
I'd appreciate any pointers whatsoever. I'm about on the verge of pulling down my UNIX Programming tome from the bookshelf, but can't be confident I'm not doing something silly specifically related to (or unsupported by) Go.