Skip to content

Alt-screen program grown mid-session leaves a stale band in the right columns after exit #3930

Description

@brianynwu

[x] I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
[x] I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

Exiting a full-screen (alternate-screen) program after the pane was grown wider mid-session leaves a band of stale dark cells down the right-hand columns of the restored view — the columns exposed by the grow. The same program run in a plain Windows Terminal WSL tab with herdr out of the path leaves no band, and vim/less grown and quit in the same herdr pane leave no band.

Expected behavior

After the program exits, the restored view has no stale cells in the columns exposed by an in-session grow, matching the standalone-terminal run and vim/less.

Reproduction

Save as repro.sh, run it in a herdr pane, grow the window wider, press q, and look at the right edge. Run it again in a plain terminal (no herdr) as the control. If a terminal wedges, run reset.

#!/usr/bin/env bash
set -u
esc=$'\x1b'
render() {
  local rows cols r line
  rows=$(tput lines 2>/dev/null || echo 24); cols=$(tput cols 2>/dev/null || echo 80)
  line=$(printf '%*s' "$cols" '' | tr ' ' '#')
  printf '%s[?2026h%s[2J' "$esc" "$esc"
  for ((r = 1; r <= rows; r++)); do printf '%s[%d;1H%s[2K%s' "$esc" "$r" "$esc" "$line"; done
  printf '%s[%d;1H%s[2K grow wider, then press q ' "$esc" "$rows" "$esc"
  printf '%s[?2026l' "$esc"
}
cleanup() {
  trap - WINCH INT TERM
  printf '%s[?7h%s[?2026h%s[?1049l%s[?25h%s[?2026l%s[0m' "$esc" "$esc" "$esc" "$esc" "$esc" "$esc"
  exit 0
}
trap 'render' WINCH; trap 'cleanup' INT TERM
printf '%s[?1049h%s[?7l%s[?25l' "$esc" "$esc" "$esc"
render
while :; do IFS= read -rsn1 -t 0.2 key || continue; case $key in q | Q) cleanup ;; esac; done

Impact

After each such exit the pane is left with a dark band down the right edge until the screen is cleared. Cosmetic but persistent in normal use of full-screen agent CLIs.

Environment

  • Herdr version: 0.9.0
  • Update channel (stable or preview): stable
  • Operating system: Linux (WSL2, Windows host)
  • Terminal: native herdr in a Windows Terminal WSL tab
  • Shell, if relevant: bash
  • Relevant config, if any: none

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglinuxaffects Linux-specific behaviormaintainer-neededrequires maintainer judgment or maintainer-only reproductionp2valid narrow or ordinary defect with limited impact or a practical workaroundrenderingterminal emulation, reflow, layout, graphics, or output rendering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions