Commit 1712c81b0a

1712c81b0af4daa50780f4b1c4947474ba4dd8a6

parent: dd06e80a07

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-24 04:29 UTC

gitbay: GITBAY_TERM=off sends no terminal size

Ref #254
.gitbay/wiki/Users.org +4
@@ -775,6 +775,10 @@ list. The server then prints:
775775=GITBAY_PAGER= turns paging off. Paging never applies to =--follow=,
776776=--json=, or piped output.
777777
778=GITBAY_TERM=off= stops the CLI sending =--term= at all, for an
779instance older than v1.36.0, which refuses the argument as an unknown
780command.
781
778782Stock ssh without the CLI's multiplexing gets the plain output unless
779783it passes the same leading argument or sets the environment variable
780784sshd is told to accept:
CHANGELOG.org +5
@@ -8,6 +8,11 @@ anything beyond "replace the binary and restart" is needed.
88
99Terminal output for the CLI (#254).
1010
11*Upgrade note.* Upgrade the instance before the CLI: an older server
12refuses the CLI's leading =--term= argument as an unknown command.
13Against an older instance, set =GITBAY_TERM=off= and the CLI sends no
14terminal size.
15
1116- At a terminal, lists print under a header, fitted to the width, with
1217 states in colour and relative ages; the next page is a command on
1318 stderr. Piped output keeps the same tab-separated rows, with
cmd/gitbay/ssh.go +3 −2
@@ -114,9 +114,10 @@ var noColor bool
114114
115115// termValue is GITBAY_TERM for this invocation: the terminal's width,
116116// and whether colour is wanted. Empty when stdout is not a terminal,
117// so piped output stays the rows stock ssh prints.
117// so piped output stays the rows stock ssh prints, and when GITBAY_TERM
118// is "off", for an instance older than --term.
118119func termValue(isTerminal bool, cols int, env func(string) string) string {
119 if !isTerminal || cols < 40 {
120 if !isTerminal || cols < 40 || env("GITBAY_TERM") == "off" {
120121 return ""
121122 }
122123 v := strconv.Itoa(cols)
cmd/gitbay/term_test.go +1
@@ -22,6 +22,7 @@ func TestTermValue(t *testing.T) {
2222 {true, 120, map[string]string{"NO_COLOR": "1"}, false, "120"},
2323 {true, 120, map[string]string{"TERM": "dumb"}, false, "120"},
2424 {true, 120, nil, true, "120"},
25 {true, 120, map[string]string{"GITBAY_TERM": "off"}, false, ""},
2526 }
2627 for _, c := range cases {
2728 noColor = c.noColor