Software /
code /
prosody
Comparison
util/prosodyctl/shell.lua @ 13050:4ae759490e31
util.prosodyctl.shell: Coerce terminal width to string (for util.stanza)
Fixes invalid attribute value: expected string, got number
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 07 Apr 2023 13:53:40 +0200 |
parent | 13047:d939bf469057 |
child | 13052:585bd71a1a97 |
comparison
equal
deleted
inserted
replaced
13049:115ce3ab5b8b | 13050:4ae759490e31 |
---|---|
28 return io.read("*line"); | 28 return io.read("*line"); |
29 end | 29 end |
30 end | 30 end |
31 | 31 |
32 local function send_line(client, line) | 32 local function send_line(client, line) |
33 client.send(st.stanza("repl-input", { width = term_width() }):text(line)); | 33 client.send(st.stanza("repl-input", { width = tostring(term_width()) }):text(line)); |
34 end | 34 end |
35 | 35 |
36 local function repl(client) | 36 local function repl(client) |
37 local line = read_line(client.prompt_string or "prosody> "); | 37 local line = read_line(client.prompt_string or "prosody> "); |
38 if not line or line == "quit" or line == "exit" or line == "bye" then | 38 if not line or line == "quit" or line == "exit" or line == "bye" then |