File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ void terminal_pager::maybe_grab_cout()
4949 if (!m_grabbed && termcolor::_internal::is_atty (std::cout))
5050 {
5151 // Should we do anything with cerr?
52- m_cout_rdbuf = std::cout.rdbuf (m_oss. rdbuf () );
52+ m_cout_rdbuf = std::cout.rdbuf (&m_stringbuf );
5353 m_grabbed = true ;
5454 }
5555}
@@ -173,7 +173,7 @@ void terminal_pager::show()
173173
174174 release_cout ();
175175
176- split_input_at_newlines (m_oss .view ());
176+ split_input_at_newlines (m_stringbuf .view ());
177177
178178 update_terminal_size ();
179179 if (m_rows == 0 || m_lines.size () <= m_rows - 1 )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class terminal_pager
5555
5656
5757 bool m_grabbed;
58- std::ostringstream m_oss ;
58+ std::stringbuf m_stringbuf ;
5959 std::streambuf* m_cout_rdbuf;
6060 std::vector<std::string> m_lines;
6161 size_t m_rows, m_columns;
You can’t perform that action at this time.
0 commit comments