Skip to content

Commit a3f4186

Browse files
committed
main: Skip prompt, highlight, autocomplete in bot mode
1 parent 5055bbc commit a3f4186

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

host.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,11 @@ func (h *Host) Connect(term *sshd.Terminal) {
160160
}
161161

162162
// Successfully joined.
163-
term.SetPrompt(GetPrompt(user))
164-
term.AutoCompleteCallback = h.AutoCompleteFunction(user)
165-
user.SetHighlight(user.Name())
163+
if !apiMode {
164+
term.SetPrompt(GetPrompt(user))
165+
term.AutoCompleteCallback = h.AutoCompleteFunction(user)
166+
user.SetHighlight(user.Name())
167+
}
166168

167169
// Should the user be op'd on join?
168170
if h.isOp(term.Conn) {
@@ -210,6 +212,11 @@ func (h *Host) Connect(term *sshd.Terminal) {
210212
// FIXME: Any reason to use h.room.Send(m) instead?
211213
h.HandleMsg(m)
212214

215+
if apiMode {
216+
// Skip the remaining rendering workarounds
217+
continue
218+
}
219+
213220
cmd := m.Command()
214221
if cmd == "/nick" || cmd == "/theme" {
215222
// Hijack /nick command to update terminal synchronously. Wouldn't

0 commit comments

Comments
 (0)