patch 9.1.1489: terminal: no visual highlight of empty cols with empty 'listchars'

Problem:  terminal: no visual highlight of empty cols when 'listchars'
          is empty (Yousef Mohammed)
Solution: reset wlv.win_attr when column is zero and we are drawing a
          terminal buffer

fixes: #17559
closes: #17618

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim
index 64b8ac8..9aa9049 100644
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -1018,4 +1018,22 @@
   bw! XTestFile
 endfunc
 
+func Test_terminal_visual_empty_listchars()
+  CheckScreendump
+  CheckRunVimInTerminal
+  CheckUnix
+
+  let lines = [
+  \ 'set listchars=',
+  \ ':term sh -c "printf ''hello\\n\\nhello''"'
+  \ ]
+  call writefile(lines, 'XtermStart1', 'D')
+  let buf = RunVimInTerminal('-S XtermStart1', #{rows: 15})
+  call term_wait(buf)
+  call term_sendkeys(buf, "V2k")
+  call VerifyScreenDump(buf, 'Test_terminal_empty_listchars', {})
+
+  call StopVimInTerminal(buf)
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab