WSL: Scrolling down in vim, wrapped lines causes artifacts
Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!
-
A brief description When scrolling down in vim (when launched from bash.exe) in a file that does not fit on a single screen, or if a long line is forced to wrap around (when line wrap is enabled), artifacts are left behind on the right-hand side. Note, that if saved, the artifacts are not present in the saved file, so I suspect it’s a console rendering issue.
-
Expected results I expect there to be no artifacts to be left behind.
99
100 void generate()
101 {
102 auto max_num = static_cast<size_t>(std::floor(std::sqrt(_max_number)));
103
104 _numbers[0] = false;
105 _numbers[1] = false;
106
107 for (size_t i = 2; i < max_num; i = next_set(i))
108 {
109 for (size_t h = i * 2; h < _numbers.size(); h += i)
110 _numbers[h] = false;
111 }
112
113 for (size_t i = 0; i < _numbers.size(); ++i)
114 {
115 if (_numbers[i])
116 {
117 ++_num_primes;
118 _primes.insert(i);
119 }
120 }
121 }
122
123 };
124
125 template<typename T>
126 class CombinationGenerator
127 {
128 public:
129 template<typename U>
130 CombinationGenerator(U&& container, std::function<bool(std::vector<T> const&)> callback, size_t n_taken)
131 : container_(std::forward<U>(container))
132 , callback_(callback)
133 , n_taken_(n_taken)
134 {}
135
136 void generate() const
137 {
138 collect(0, n_taken_ - 1, std::vector<T>());
139 }
140
141 private:
142
143 bool collect(size_t start, size_t depth, std::vector<T> result) const
144 {
145 result.push_back(T());
146
147 for (size_t i = start; i < container_.size() - depth; ++i)
148 {
149 result.back() = container_[i];
150 if (depth == 0)
151 {
152 if (!callback_(result))
153 return false;
154 }
155 else if (!collect(i + 1, depth - 1, result))
156 return false;
157 }
158
159 return true;
160 } 99,0-1 62%
-- INSERT --
- Actual results (with terminal output if applicable)

99
100 void generate()
101 {
102 auto max_num = static_cast<size_t>(std::floor(std::sqrt(_max_number)));
103
104 _numbers[0] = false;
105 _numbers[1] = false;
106
107 for (size_t i = 2; i < max_num; i = next_set(i))
108 {
109 for (size_t h = i * 2; h < _numbers.size(); h += i)
110 _numbers[h] = false;
111 }
112
113 for (size_t i = 0; i < _numbers.size(); ++i)
114 {
115 if (_numbers[i])
116 {
117 ++_num_primes;
118 _primes.insert(i);
119 }
120 }
121 }
122 122,0-1 38%
123 }; 123,1 39%
124 124,0-1 39%
125 template<typename T> 125,1 40%
126 class CombinationGenerator 126,1 41%
127 { 127,1 41%
128 public: 128,1 42%
129 template<typename U> 129,1-2 42%
130 CombinationGenerator(U&& container, std::function<bool(std::vector<T> const&)> callback, size130,1-2 43%
131 : container_(std::forward<U>(container)) 131,1-2 44%
132 , callback_(callback) 132,1-2 44%
133 , n_taken_(n_taken) 133,1-2 45%
134 {} 134,1-2 46%
135 135,0-1 46%
136 void generate() const 136,1-2 47%
137 { 137,1-2 48%
138 collect(0, n_taken_ - 1, std::vector<T>()); 138,1-2 48%
139 } 139,1-2 49%
140 140,0-1 50%
141 private: 141,1 50%
142 142,0-1 51%
143 bool collect(size_t start, size_t depth, std::vector<T> result) const 143,1-2 51%
144 { 144,1-2 52%
145 result.push_back(T()); 145,1-2 53%
146 146,0-1 53%
147 for (size_t i = start; i < container_.size() - depth; ++i) 147,1-2 54%
148 { 148,1-2 55%
149 result.back() = container_[i]; 149,1-2 55%
150 if (depth == 0) 150,1-2 56%
151 { 151,1-2 57%
152 if (!callback_(result)) 152,1-2 57%
153 return false; 153,1-2 58%
154 } 154,1-2 58%
155 else if (!collect(i + 1, depth - 1, result)) 155,1-2 59%
156 return false; 156,1-2 60%
157 } 157,1-2 60%
158 158,0-1 61%
159 return true; 159,1-2 62%
160 } 160,1-2 62%
-- INSERT --
-
Your Windows build number Version 10.0.15002
-
Steps / All commands required to reproduce the error from a brand new installation Have a long file with long lines. Edit the file with vim in a console window of around 80-100 character width. Scroll down (‘j’) until the cursor causes the screen to scroll. Using page up/page down causes the screen to reset.
-
Strace of the failing command n/a
-
Required packages and commands to install vim
See our contributing instructions for assistance.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 1
- Comments: 16 (6 by maintainers)
This is fixed in build 15019
@benhillis is correct. Not sure what caused this, but it’s already fixed 👍
@offero Please don’t necro old threads without providing useful additional information. If you are truly seeing this on recent builds, then it’s certainly unrelated to this fixed issue from 2 years ago. Please file a new issue on the Console repo that @DarthSpock mentioned if you’d like us to take a look.
@offero https://github.com/Microsoft/Console/issues
@mkarpoff could you post a message here when it goes to insiders? Thanks again!