diff --git a/chat/command.go b/chat/command.go index 182d00f..fe9355e 100644 --- a/chat/command.go +++ b/chat/command.go @@ -7,6 +7,7 @@ import ( "fmt" "strings" "time" + "sort" "github.com/shazow/ssh-chat/chat/message" "github.com/shazow/ssh-chat/internal/sanitize" @@ -189,6 +190,7 @@ func InitCommands(c *Commands) { } names := room.Members.ListPrefix("") + sort.Slice(names, func(i, j int) bool { return names[i].Key() < names[j].Key() }) colNames := make([]string, len(names)) for i, uname := range names { colNames[i] = colorize(uname.Value().(*Member).User)