question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

improve previous line count

See original GitHub issue

The previous line count is being tracked by log-update but it does not take the terminal size into account.

For instance, if you log a line of 40 characters while the terminal is only 30 characters, it will be printed on 2 lines. After calling log-update again, it will only erase the 2nd line because the previous line count was only 1 and not 2.

So we have to iterate over all the lines here and calculate the number of printed lines instead.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
kevvacommented, Sep 20, 2016

Feel free if you have time 😃.

0reactions
Jameskmongercommented, Apr 18, 2017

@SamVerschueren yes I have tested it but it does not fix the issue, testing #16 gives the following final output in cmder in Windows 10:

cmder windows 10

And in command prompt in windows 10:

command prompt windows 10


My fix above gives the following output in cmder in Windows 10:

cmder windows 10

And in command prompt in windows 10:

command prompt windows 10

Read more comments on GitHub >

github_iconTop Results From Across the Web

Count number of lines of output from previous program
The problem is, the program takes a long time to run, and I want to display the output to the user. Is there...
Read more >
Fastest way to count number of lines? - Stack Overflow
Now allocate a buffer of that size and read (using read or fread ) blocks of that size. Then iterate this in-memory block...
Read more >
Add or remove line numbers - Microsoft Support
For more advanced line numbering options, such as numbering at different intervals, click Line Numbering Options, and then click Line Numbers on the...
Read more >
How to Count Lines of Code: A Complete Overview | LinearB
In this post, we'll discuss the importance of counting lines of code including how to use VS code counter, cloc, and xargs.
Read more >
Python Count Number of Lines in a File [5 Ways] - PYnative
Set counter to zero · Use a for-loop to read each line of a file, and if the line is nonempty, increase line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found