Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "reflow"ing the Terminal buffer #4741

Merged
merged 54 commits into from
Mar 13, 2020

Commits on Jan 13, 2020

  1. Configuration menu
    Copy the full SHA
    b5c8c85 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9aec694 View commit details
    Browse the repository at this point in the history
  3. Try to wrap the line properly with conpty

      This confusingly doesn't always work
    zadjii-msft committed Jan 13, 2020
    1 Configuration menu
    Copy the full SHA
    1a2654d View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2020

  1. This works, fixing the ECH at end of wrapped line bug

      The trick was that when a line that was exactly filled was followed by an
      empty line, we'd ECH when the cursor is virtually on the last char of the
      wrapped line. That was wrong. For a scenario like:
    
      |ABCDEF|
      |      |
    
      We'd incorrectly render that as ["ABCDEF", "^[[K", "\r\n"]. That ECH in the
      middle there would erase the 'F', because the cursor was virtually still on
      the 'F' (because it had deferred wrapping to the next char).
    
      So, when we're about to ECH following a wrapped line, reset the _wrappedRow
      first, to make sure we correctly \r\n first.
    zadjii-msft committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    aae6ce6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    416be46 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2020

  1. Merge branch 'master' into dev/migrie/f/conpty-wrapping-003

    # Conflicts:
    #	src/buffer/out/textBuffer.cpp
    #	src/buffer/out/textBuffer.hpp
    #	src/host/screenInfo.cpp
    zadjii-msft committed Jan 27, 2020
    Configuration menu
    Copy the full SHA
    7f341a2 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2020

  1. I think this is all I need to support wrapped lines in the Terminal

    (cherry picked from commit c21f740)
    zadjii-msft committed Jan 28, 2020
    Configuration menu
    Copy the full SHA
    edeb346 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ce3138c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4a7f2e4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bfde821 View commit details
    Browse the repository at this point in the history
  5. add a roundtrip test

    zadjii-msft committed Jan 28, 2020
    Configuration menu
    Copy the full SHA
    e000388 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c040a82 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0755fd7 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2020

  1. Add PaintCursor tracing

    zadjii-msft committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    86623f5 View commit details
    Browse the repository at this point in the history
  2. This actually fixes this bug - different terminals EOL wrap different…

    …ly, esp conhost v wt v gnome-terminal. Remove ambiguity - just hardcore move the cursor in this scenario.
    zadjii-msft committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    7fd5d51 View commit details
    Browse the repository at this point in the history
  3. Add some comments for PR

    zadjii-msft committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    9b6554b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0a98cce View commit details
    Browse the repository at this point in the history
  5. Revert "Try adding a test, but I can't get the test to repro the orig…

    …inal behavior quite right"
    
    This reverts commit 0a98cce.
    zadjii-msft committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    40b4966 View commit details
    Browse the repository at this point in the history
  6. Merge remote-tracking branch 'origin/master' into dev/migrie/b/1245-I…

    …-actually-did-it-this-time
    zadjii-msft committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    e0d251c View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2020

  1. Configuration menu
    Copy the full SHA
    b3de042 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    96642de View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5a72af9 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'dev/migrie/b/1245-I-actually-did-it-this-time' into dev…

    …/migrie/f/reflow-buffer-on-resize
    
    # Conflicts:
    #	src/renderer/vt/XtermEngine.cpp
    #	src/renderer/vt/vtrenderer.hpp
    zadjii-msft committed Jan 30, 2020
    Configuration menu
    Copy the full SHA
    1788cb1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    74a5283 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9580715 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    edea9a3 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2020

  1. Configuration menu
    Copy the full SHA
    097b62c View commit details
    Browse the repository at this point in the history
  2. fix tests

    zadjii-msft committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    2e815c8 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2020

  1. Configuration menu
    Copy the full SHA
    de9911d View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2020

  1. Merge remote-tracking branch 'origin/master' into dev/migrie/f/reflow…

    …-buffer-on-resize
    
    # Conflicts:
    #	src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp
    zadjii-msft committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    e653713 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2020

  1. Merge branch 'master' into dev/migrie/f/reflow-buffer-on-resize

    # Conflicts:
    #	src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp
    #	src/cascadia/UnitTests_TerminalCore/TerminalBufferTests.cpp
    #	src/renderer/base/renderer.cpp
    #	src/renderer/vt/paint.cpp
    zadjii-msft committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    1d87f66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0c91a9b View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2020

  1. Configuration menu
    Copy the full SHA
    0f283b4 View commit details
    Browse the repository at this point in the history
  2. add safemath for carlos

    zadjii-msft committed Mar 2, 2020
    Configuration menu
    Copy the full SHA
    2ef2d88 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cc7b2d3 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2020

  1. Configuration menu
    Copy the full SHA
    a8913ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0626c8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4c368c3 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2020

  1. Configuration menu
    Copy the full SHA
    4e3d008 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6070095 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7cca547 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2020

  1. Configuration menu
    Copy the full SHA
    1044d49 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    277f280 View commit details
    Browse the repository at this point in the history
  3. These bugs were twofold

      one was weird: after the reflow, the conpty would know that the cursor was in
      a different position than the last time it wrote text, so it would emit a
      sequence to position the cursor. However, with quirky resize, the terminal's
      cursor actually _was_ in the right position. So when conpty would emit a \n to
      move the cursor one line down, that would cause the Terminal to be out of
      sync.
    
      The second: we were calculating the new position of the top row of the buffer
      using the first cell of the row, not the last. This meant that if the top row
      wrapped in this new resize, we'd place the top of the new viewport one row
      higher than conpty would
    zadjii-msft committed Mar 10, 2020
    Configuration menu
    Copy the full SHA
    7a40fe3 View commit details
    Browse the repository at this point in the history
  4. When we increase the width of the buffer, always use the old viewport…

    … top to calculate our new position
    
      The trick with this case was that when there were multiple wrapped lines
      inside the viewport, the lastLine of the buffer would be farther down than we
      actually wanted. We'd still want the position of the top row in the buffer
      here, because the lines in the buffer could have _only_ de-wrapped, taking up
      less lines than before.
    
      This is however, _not_ right. When you execute `ll`, then increase the height,
      then decrease the width, we'll snape the bottom of the viewport to the bottom
      of the output text, as opposed to pinning to the top of the text.
    zadjii-msft committed Mar 10, 2020
    1 Configuration menu
    Copy the full SHA
    a3a9464 View commit details
    Browse the repository at this point in the history
  5. When we change the width at all, use the top, not the bottom.

      This fixes the bug from before. This breaks when we simultaneously change
      width and height. Scenario is powershell, `type rwr-temp.txt`. Increase font size. Viewport is not at the actual bottom of the buffer anymore -.-
    
      I think we need to use the scrollback value unless we're decreasing the
      height of the buffer as well
    zadjii-msft committed Mar 10, 2020
    Configuration menu
    Copy the full SHA
    4ca280c View commit details
    Browse the repository at this point in the history
  6. This seems like it finally does it

      If the terminal height is getting smaller, always use the lastline to figure
      out where the new bottom line should be oh no that's not going to work is it.
      what happens with dy<0, dx>0?
    
      * dy<0, dx<0:
        - The Terminal is getting shorter, buffer less wide. Use the end of the text
          to find where we should place the viewport, since lines might have newly
          wrapped
      * dy<0, dx>0:
        - The Terminal is getting shorter, buffer wider. ?? Use the old top to find the
          new position. Lines migh de-wrap, and we'll want to stay stuck to the
          topmost line of the old buffer. ??
      * dy>0, dx<0:
        - The Terminal is getting taller, buffer less wide.
      * dy>0, dx>0:
        - The Terminal is getting taller, buffer wider.  Use the old top to find the
          new position. Lines migh de-wrap, and we'll want to stay stuck to the
          topmost line of the old buffer.
    zadjii-msft committed Mar 10, 2020
    Configuration menu
    Copy the full SHA
    077f678 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2020

  1. Configuration menu
    Copy the full SHA
    85efaa7 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2020

  1. Configuration menu
    Copy the full SHA
    9127e1c View commit details
    Browse the repository at this point in the history
  2. fix the tests

    zadjii-msft committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    61ccc28 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aff3cc5 View commit details
    Browse the repository at this point in the history
  4. fix the renderer test

    zadjii-msft committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    0532c66 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5394b30 View commit details
    Browse the repository at this point in the history
  6. Merge remote-tracking branch 'origin/master' into dev/migrie/f/reflow…

    …-buffer-on-resize
    
    # Conflicts:
    #	src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp
    DHowett committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    7ecd3c6 View commit details
    Browse the repository at this point in the history