-
Notifications
You must be signed in to change notification settings - Fork 179
IND/RI/NEL control sequence implementations #350
base: master
Are you sure you want to change the base?
Changes from 5 commits
4741f7f
3d74757
85fa067
ab5a9bd
64d5dd4
5921139
796b054
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ public class TerminalOutput : Gee.ArrayList<OutputLine> { | |
public void parse_stream_element(TerminalStream.StreamElement stream_element) { | ||
switch (stream_element.stream_element_type) { | ||
case TerminalStream.StreamElement.StreamElementType.TEXT: | ||
//message(_("Text sequence received: '%s'"), stream_element.text); | ||
message(_("Text sequence received: '%s'"), stream_element.text); | ||
|
||
// Print only text that has not been printed yet | ||
string text_left = stream_element.text.substring( | ||
|
@@ -124,6 +124,8 @@ public class TerminalOutput : Gee.ArrayList<OutputLine> { | |
// This code causes a line feed or a new line operation | ||
// TODO: Does LF always imply CR? | ||
move_cursor(cursor_position.line + 1, 0); | ||
terminal.terminal_view.terminal_output_view.add_line_views(); | ||
terminal.terminal_view.terminal_output_view.scroll_to_position(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two lines should not be necessary for the code to work (follow the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When these lines are omitted, scrolling down, up, and then back down in |
||
break; | ||
|
||
case TerminalStream.StreamElement.ControlSequenceType.HORIZONTAL_TAB: | ||
|
@@ -223,6 +225,24 @@ public class TerminalOutput : Gee.ArrayList<OutputLine> { | |
break; | ||
|
||
case TerminalStream.StreamElement.ControlSequenceType.CURSOR_FORWARD: | ||
case TerminalStream.StreamElement.ControlSequenceType.REVERSE_INDEX: | ||
screen_offset -= 1; | ||
move_cursor(cursor_position.line - stream_element.get_numeric_parameter(0,1), cursor_position.column); | ||
terminal.terminal_view.terminal_output_view.add_line_views(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. This should be taken care of automatically. If it isn't, there is a bug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When these lines are ommitted, the terminal cannot follow the upward scroll in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I cannot reproduce that problem, I occasionally see similar issues, which seem to be caused by https://github.com/p-e-w/finalterm/blob/master/src/Terminal.vala#L109, a piece of code that sometimes does not work the way it should according to the GLib API docs. In any case, I'm afraid that calling I'll try to dig a bit deeper and maybe fix it entirely so I can merge a clean version of this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take a look at the code you mentioned, I definitely would like to get more familiar with the code and the mvc pattern you've implemented There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! If you need any pointers, just drop me a line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you have the chance to revisit this? Meanwhile, I've made some changes to the way scrolling works, maybe that improved the situation already. Even if that should not be the case and those lines are indeed necessary, I'd probably still like to merge your PR since it fixes many problems with terminal programs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've taken on a job which makes FOSS difficult. If you think the existing code is fixing some problems, please feel free to merge! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand. Thank you anyway for your contribution and good luck in your new job! |
||
break; | ||
|
||
case TerminalStream.StreamElement.ControlSequenceType.NEXT_LINE: | ||
screen_offset += 1; | ||
move_cursor(cursor_position.line + stream_element.get_numeric_parameter(0,1), 0); | ||
terminal.terminal_view.terminal_output_view.add_line_views(); | ||
break; | ||
|
||
case TerminalStream.StreamElement.ControlSequenceType.INDEX: | ||
screen_offset += 1; | ||
move_cursor(cursor_position.line + stream_element.get_numeric_parameter(0,1), cursor_position.column); | ||
terminal.terminal_view.terminal_output_view.add_line_views(); | ||
break; | ||
|
||
case TerminalStream.StreamElement.ControlSequenceType.CHARACTER_POSITION_RELATIVE: | ||
// The CUF sequence moves the active position to the right. | ||
// The distance moved is determined by the parameter (default: 1) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be commented again as it slows some large terminal programs to a crawl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented