Mercurial > prosody-hg
comparison util/prosodyctl/shell.lua @ 12529:7dae6d29b71d
prosodyctl shell: Communicate width of terminal to mod_admin_shell
This lets it adjust the width of tables to the actual terminal width.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 30 May 2022 15:28:44 +0200 |
| parents | bdb9577a4830 |
| children | cfdc8cca64d3 |
comparison
equal
deleted
inserted
replaced
| 12528:8e780079a424 | 12529:7dae6d29b71d |
|---|---|
| 25 return io.read("*line"); | 25 return io.read("*line"); |
| 26 end | 26 end |
| 27 end | 27 end |
| 28 | 28 |
| 29 local function send_line(client, line) | 29 local function send_line(client, line) |
| 30 client.send(st.stanza("repl-input"):text(line)); | 30 client.send(st.stanza("repl-input", { width = os.getenv "COLUMNS" }):text(line)); |
| 31 end | 31 end |
| 32 | 32 |
| 33 local function repl(client) | 33 local function repl(client) |
| 34 local line = read_line(client.prompt_string or "prosody> "); | 34 local line = read_line(client.prompt_string or "prosody> "); |
| 35 if not line or line == "quit" or line == "exit" or line == "bye" then | 35 if not line or line == "quit" or line == "exit" or line == "bye" then |
