Use STATUSLINE_WIDTH env var for reliable width detection
term.GetSize returns unreliable values when running inside Claude Code over SSH. Replace the hardcoded statuslineWidthOffset with STATUSLINE_WIDTH env var (set in Claude Code settings), falling back to terminal detection, then 80 columns.
This commit is contained in:
@@ -756,10 +756,9 @@ func TestTokenUsage_ZeroValues(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatuslineWidthOffset_Constant(t *testing.T) {
|
||||
// Verify the constant is defined and reasonable
|
||||
if statuslineWidthOffset <= 0 || statuslineWidthOffset > 20 {
|
||||
t.Errorf("statuslineWidthOffset = %d, expected between 1 and 20", statuslineWidthOffset)
|
||||
func TestDefaultStatuslineWidth_Constant(t *testing.T) {
|
||||
if defaultStatuslineWidth < 40 || defaultStatuslineWidth > 300 {
|
||||
t.Errorf("defaultStatuslineWidth = %d, expected between 40 and 300", defaultStatuslineWidth)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user