Bug 244182 - empty lines are shown
Summary: empty lines are shown
Alias: None
Product: Fedora
Classification: Fedora
Component: gtkterm   
(Show other bugs)
Version: 7
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2007-06-14 12:58 UTC by Dan Horák
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version: 0.99.5-4.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-19 21:38:51 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
listing with additional empty lines (37.16 KB, image/png)
2007-06-14 13:00 UTC, Dan Horák
no flags Details
it should look like this (47.71 KB, image/png)
2007-06-14 13:01 UTC, Dan Horák
no flags Details
added debugging (7.08 KB, patch)
2007-06-15 18:22 UTC, Dan Horák
no flags Details | Diff
debugging results (658 bytes, application/x-gzip)
2007-06-15 18:22 UTC, Dan Horák
no flags Details
PATCH fixing the crlf issues (4.44 KB, patch)
2007-06-16 11:00 UTC, Hans de Goede
no flags Details | Diff

Description Dan Horák 2007-06-14 12:58:24 UTC
Description of problem:
The terminal adds empty lines during listing a configuration from a Cisco
switch. After switching the view to HEX and the back to ASCII, lines are
displayed correctly. For details see the attachments.

Version-Release number of selected component (if applicable):

How reproducible:
use gtkterm as a console for Cisco switch/router

Expected results:
no additional empty lines displayed

Additional info:
- maybe a problem of the vte library
- EOL characters from Cisco are CR+LF

Comment 1 Dan Horák 2007-06-14 13:00:14 UTC
Created attachment 156988 [details]
listing with additional empty lines

Comment 2 Dan Horák 2007-06-14 13:01:03 UTC
Created attachment 156989 [details]
it should look like this

Comment 3 Hans de Goede 2007-06-14 18:25:55 UTC
Is this with the configuration -> CR LF auto feature on / checkbox checked?

Can you do a file -> Save Raw file of a session reproducing this?

Comment 4 Dan Horák 2007-06-15 12:14:59 UTC
"CR LF auto" feature doesn't have effect on the displayed text, but makes a
change in the saved "Raw file".

results from captured files:
minicom => EOL = LF
gtkterm + CRLF auto = off => EOL = CR+LF
gtkterm + CRLF auto = on => EOL = doubled CR+LF (but not every time)

I would tell that EOL handling is a bit broken :-) Candidates are put_text()
from widgets.c and put_chars() from buffer.c. I will try to compile a version
with some debugging enabled during the weekend and do more tests.

Comment 5 Hans de Goede 2007-06-15 12:42:39 UTC
Thanks, I'm awaiting your results

Comment 6 Dan Horák 2007-06-15 18:22:00 UTC
Created attachment 157139 [details]
added debugging

The handling is really broken. The attached patch creates 3 files - raw output
from serial line, preprocessed output stored in a buffer and displayed output.

With "CR+LF auto" = off the raw and buffer files are the same, but the
displayed result has doubled CR+LF.
With "CR+LF auto" = on, the doubled CR+LF are already in the buffer.

Comment 7 Dan Horák 2007-06-15 18:22:45 UTC
Created attachment 157140 [details]
debugging results

Comment 8 Hans de Goede 2007-06-16 09:32:26 UTC

I believe I've found the culprit for this happening even with autocrlf off and
I'll also fix autocrlf behaviour. This is just a headsup as I don't want us to
be wasting time by working on the samething independently.

I'll report back when I have something to test for you.

Comment 9 Hans de Goede 2007-06-16 11:00:18 UTC
Created attachment 157187 [details]
PATCH fixing the crlf issues

This patch should fix the issues you've been seeing, independend of the auto
crlf setting, and when auto crlf is needed it should even do the right thing.

Can you please test this both with and without auto crlf, I currently don't
have the hardware to test this.


Comment 10 Dan Horák 2007-06-16 12:44:53 UTC
+      /* BUFFER_RECEPTION*2 for worst case scenario, all \n or \r chars */
+      char out_buffer[BUFFER_RECEPTION*2];
+      int i, out_size;

+      int i, out_size = 0; !!!

CRLF auto = off => OK
CRLF auto = on => OK with initialized out_size variable in buffer.c (in
put_chars()) to zero, you have probably missed the compiler warning

Great work, Hans. Thank you.

Comment 11 Hans de Goede 2007-06-16 19:45:54 UTC
(In reply to comment #10)
> Great work, Hans. Thank you.

Your welcome, and thank you too!

I'll build a version with the patch included for FC-6, F-7 and devel. The F-7
version will first become available in updates-testing, at which time the
updates system will post a comment here saying so. I would be much obliged if
you could test the version from updates-testing when it becomes available, so
that I can move it to the regular updates repository.

Comment 12 Fedora Update System 2007-06-18 16:38:33 UTC
gtkterm-0.99.5-4.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Dan Horák 2007-06-19 06:10:28 UTC
just done some testing and it looks good

Comment 14 Fedora Update System 2007-06-19 21:38:43 UTC
gtkterm-0.99.5-4.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.