mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
Only send EOF in writable sessions
Currently EOF is sent to the pty even when read-only mode is requested. This can cause trouble in attached tmux sessions, for example. Since the EOF typically used in shells as a shortcut exit, this can result in undesired disconnects.
This commit is contained in:
parent
6ece5141c6
commit
8e5a277bb3
@ -177,7 +177,9 @@ func (app *App) generateHandler() func(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
<-exit
|
<-exit
|
||||||
|
if app.PermitWrite {
|
||||||
fio.Write([]byte{4})
|
fio.Write([]byte{4})
|
||||||
|
}
|
||||||
fio.Close()
|
fio.Close()
|
||||||
conn.Close()
|
conn.Close()
|
||||||
log.Printf("Connection closed: %s", r.RemoteAddr)
|
log.Printf("Connection closed: %s", r.RemoteAddr)
|
||||||
|
Loading…
Reference in New Issue
Block a user