Bug 225501 - Saved history contains one extra empty line every 500 lines.
Summary: Saved history contains one extra empty line every 500 lines.
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 13:11 UTC by ptf
Modified: 2011-09-21 15:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ptf 2010-02-04 13:11:11 UTC
Version:            (using KDE 4.3.4)
OS:                Linux
Installed from:    openSUSE RPMs

Setting the scrollback option to unlimited history size and saving
the output into file, the file is little corrupted, i.e. there is an
additional empty line every 500 lines. Example:

--------------------------------------------------------
user@pc:~> for i in {1..1002}; do echo $i; done;
1                                                  
2                                                  
[...]
498                                                
499                                                
             [<--here]
500                                                
501                                                
[...]
998
999
             [<--and here again]
1000
1001
1002
user@pc:~>
--------------------------------------------------------
Comment 1 Kurt Hindenburg 2010-02-11 17:35:28 UTC
Yep, I see the same output.
Comment 2 Kurt Hindenburg 2010-03-02 04:42:29 UTC
SessionController.cpp

 const int LINES_PER_REQUEST = 500;


        // if there are still more lines to process after this request
        // then insert a new line character
        // to ensure that the next block of lines begins on a new line
        //
        // FIXME - There is still an extra new-line at the end of the save data.
        if ( copyUpToLine <= sessionLines-1 )
        {
            stream << '\n';
        }
Comment 3 Jekyll Wu 2011-07-28 15:22:35 UTC
(In reply to comment #2)
> 

I do not quite understand that piece of code and comment. I tried to compile konsole without that piece of code, and did not notice problems in saved history .
Comment 4 Jekyll Wu 2011-09-21 15:20:33 UTC
Git commit 031a9d54e238c3372ee181b7bf7d290a320ea61d by Jekyll Wu.
Committed on 24/07/2011 at 06:06.
Pushed by jekyllwu into branch 'master'.

Do not insert one extra emtpy line every 500 lines in the saved history.

The code for adding that extra empty line was introduced in commit
d3d909 (4 years ago). The reason and intention is not clear, so removing
those code might cause regression. Anyway, this commit is simple and can
be reverted easily, if unfortunately needed.

BUG: 225501
FIXED-IN: 4.8
REVIEW: 102652

M  +0    -11   src/SessionController.cpp

http://commits.kde.org/konsole/031a9d54e238c3372ee181b7bf7d290a320ea61d