diff --git a/host.go b/host.go index 176187b..8918964 100644 --- a/host.go +++ b/host.go @@ -146,6 +146,14 @@ func (h *Host) Connect(term *sshd.Terminal) { break } + // Gross hack to override line echo in golang.org/x/crypto/ssh/terminal + // It needs to live before we render any responses. + term.Write([]byte{ + 27, '[', 'A', // Up + 27, '[', '2', 'K', // Clear line + }) + // May the gods have mercy on our souls. + err = ratelimit.Count(1) if err != nil { user.Send(message.NewSystemMsg("Message rejected: Rate limiting is in effect.", user)) @@ -162,14 +170,6 @@ func (h *Host) Connect(term *sshd.Terminal) { m := message.ParseInput(line, user) - // Gross hack to override line echo in golang.org/x/crypto/ssh/terminal - // It needs to live before we render the resulting message. - term.Write([]byte{ - 27, '[', 'A', // Up - 27, '[', '2', 'K', // Clear line - }) - // May the gods have mercy on our souls. - if m, ok := m.(*message.CommandMsg); ok { // Other messages render themselves by the room, commands we'll // have to re-echo ourselves manually.