Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

IND/RI/NEL control sequence implementations #350

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

cepko33
Copy link

@cepko33 cepko33 commented Aug 31, 2014

This is the first in what will be a series of control sequence implementations, starting off with INDEX, REVERSE_INDEX, and NEXT_LINE. Currently, the steps used for each are:

  1. inc/dec the scroll_offset
  2. move cursor down/up
  3. allocate/deallocate line views

In addition, the VERTICAL_TAB case was modified to allocate new line views and then scroll to the bottom of the terminal view

My main use case for this feature was man, so once I could successfully scroll up and down, I knew that progress had been made.

Some potential future control sequences have been added to the enum along with markings specifying which sequences have been implemented or not.

Bugs Introduced:
While running the vttest display test (option 1) the scroll_offset seems to become negative to around -37 or so, and I'm interested in the function erase_range_screen which seems to be accessing terminal space with an "absolute position"

private void erase_range_screen(CursorPosition start_position = {1, 1},
    CursorPosition end_position = {terminal.lines, terminal.columns + 1}) {
    var absolute_start_position = get_absolute_position(start_position);
    var absolute_end_position = get_absolute_position(end_position);

    // Constrain positions to permissible range
    absolute_start_position.line = int.min(absolute_start_position.line, size - 1);

    absolute_start_position.column = int.min(absolute_start_position.column, //<- Fails here
        get(absolute_start_position.line).get_length()); //<-------- due to negative index

    absolute_end_position.line = int.min(absolute_end_position.line, size - 1);
    absolute_end_position.column = int.min(absolute_end_position.column,
        get(absolute_end_position.line).get_length());

    erase_range(absolute_start_position, absolute_end_position);
    }

@cepko33 cepko33 changed the title REVERSE_INDEX implementation IND/RI/NEL control sequence implementations Aug 31, 2014
@@ -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);
Copy link
Owner

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented

@cepko33
Copy link
Author

cepko33 commented Sep 3, 2014

For the changes to the VERTICAL_TAB and REVERSE_INDEX switches, my test case was the man program, and only with the changes that I made do I get the expected scrolling behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants