Skip to content
  • Jeff King's avatar
    test-terminal: set TERM=vt100 · e433749d
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The point of the test-terminal script is to simulate in the
    test scripts an environment where output is going to a real
    terminal.
    
    But since test-lib.sh also sets TERM=dumb, the simulation
    isn't very realistic. The color code will skip auto-coloring
    for TERM=dumb, leading to us liberally sprinkling
    
      test_terminal env TERM=vt100 git ...
    
    through the test suite to convince the tests to actually
    generate colors. Let's set TERM for programs run under
    test_terminal, which is one less thing for test-writers to
    remember.
    
    In most cases the callers can be simplified, but note there
    is one interesting case in t4202. It uses test_terminal to
    check the auto-enabling of --decorate, but the expected
    output _doesn't_ contain colors (because TERM=dumb
    suppresses them). Using TERM=vt100 is closer to what the
    real world looks like; adjust the expected output to match.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    e433749d