Commit Graph
177 Commits
Author SHA1 Message Date
Wez Furlong 3777da13d2 fix deprecation warnings 2019-03-22 22:17:54 -07:00
Wez Furlong fa9bf57e86 fix line feed movement behavior
We were incorrectly treating it as \r\n, but it should only have
been moving vertically.

This fixes the positioning of the cursor when using eg:

`dialog --yesno hello 0 0`

Without this change, the cursor would be way over to the left.
With this change, the cursor is correctly positioned inside
the "YES" box.
2019-03-22 22:14:17 -07:00
Wez Furlong 49467515d6 when erasing the display ensure line size matches physical
In the case where the screen was enlarged, we don't eagerly resize
the line vectors.

If a subsequent erase display occurred, we'd only erase to the old
size of the lines, rather than the new size, which could result
in a black square in the upper right corner of the display.

Repro scenario is:

* resize window larger than initial height
* `dialog --yesno hello 0 0`

The dialog background should fill the display.
2019-03-22 21:59:54 -07:00
Wez Furlong cbc1462bb4 fix color of erased characters
This was responsible for eg: dialog rendering a black (or whatever
the default background color was) strip behind the text in an
invocation like:

`dialog --yesno hello 0 0`

Rather than render a default cell, render a blank cell using the
current pen.
2019-03-22 21:45:51 -07:00
Wez Furlong 54324121f2 implement basic DEC Line drawing mode
This improves the rendering of eg: `dialog`
2019-03-22 21:28:42 -07:00
Wez Furlong 222e278720 adopt OneBased type for a number of row/col escape sequences 2019-03-22 20:41:50 -07:00
Wez Furlong 29c7610ead add OneBased helper 2019-03-22 20:41:50 -07:00
Wez Furlong e68bf65b2f clean up some of the newer escape sequence processing 2019-03-22 20:41:50 -07:00
Wez Furlong 3003654cc8 fix apt upgrade scrolling issue
This was an off-by-one issue when using scroll margins just shorter
than the screen and when scrollback is enabled.

Added a unit test to verify the behavior.
2019-03-22 20:41:50 -07:00
Wez Furlong 6cbb3ba432 impl IRM insert mode and improve esctest conformance
I've had mixed results with esctest; the IRM and cursor save/restore
tests fail for me in terminal.app, iterm2 and xterm, and fail in the
same way on wezterm, so I'm not sure if I'm not running those tests
correctly.  However, they did encourage the discovery of some other
real issues in the wezterm emulation.
2019-03-22 20:41:50 -07:00
Wez Furlong 9702d1cf5a Add plumbing for running esctest 2019-03-22 20:41:50 -07:00
Wez Furlong c33bbc8f23 clamp scroll values rather than asserting
I've been looking at https://gitlab.freedesktop.org/terminal-wg/esctest/tree/master
to verify some behaviors and found that it would send out of range
values that would cause wezterm to panic.  Rather than panic, just
clamp.
2019-03-22 20:41:50 -07:00
Wez Furlong bdfef1fd79 implement Window::ReportTextAreaSizeCells 2019-03-22 20:41:50 -07:00
Wez Furlong fd2e5855a5 Implement CSI REP 2019-03-22 20:41:50 -07:00
Wez Furlong 2c32eb9337 recognize window management related CSI
These were showing up as unrecognized sequences on my mac, and I
wondered what they were.  We now parse them and do nothing with
them, other than print out the parsed form :)
2019-03-22 20:41:50 -07:00
Wez Furlong 1a883a40e9 use vte with larger OSC buffer support
I wanted to see how much work remains to enable iterm2 image
display; one of the blockers was a limit in the size of the
buffer in the vte crate, which has been removed in my fork
of vte.

As part of testing our ability to absorb that data, I found
a couple of issues with applying the image cells to the display,
so this commit also takes care of that.

We still don't have code to connect the cell image data to the
opengl render layer.
2019-03-22 20:41:50 -07:00
Wez Furlong 217ad94c80 fixup tests for Rc<Hyperlink> -> Arc<Hyperlink> change 2019-03-22 20:41:50 -07:00
Wez Furlong fe7502fc0b implement coarse tab data rpc PoC
This required switching away from Rc to Arc so that the data in the
client can transit between threads.

This isn't useful yet.
2019-03-22 20:41:50 -07:00
Wez Furlong 7cdd1876d1 Enable serializing various Line and Cell related structs 2019-03-22 20:41:50 -07:00
Wez Furlong e773cff24e adjust tests for pty -> Write changes 2019-03-02 12:29:17 -08:00
Wez Furlong 6c8a9e999e splitting writer out of Tab::pty() 2019-03-02 11:27:11 -08:00
Wez Furlong 0c3410fb6a factor out more of the mouse processing 2019-03-02 09:45:10 -08:00
Wez Furlong 61e7f2d0fe slightly refine some mouse processing code 2019-03-02 09:40:05 -08:00
Wez Furlong bc15fc4665 split mouse event processing into separate functions 2019-03-02 09:33:58 -08:00
Wez Furlong 5565ccd30e remove host from key_down signature 2019-03-02 09:33:58 -08:00
Wez Furlong 8f13e53ac8 move gui keyboard shortcut processing to guicommon 2019-03-02 09:33:58 -08:00
Wez Furlong f261f079f7 lift clipboard hotkeys up to gui layer
My original idea was that I would centralize of the key binding
logic in the terminalstate, but this places a bit of a burden on
the TerminalHost portion of the interface.

In particular: when running a multiplexer server we may be headless
or have multiple heads.  In that scenario we want the terminal
to be backed by a virtualized screen, and that means removing
the direct callback to access eg: the host clipboard.  This
diff is the first of a couple that have the goal of removing
those sorts of dependencies.
2019-03-02 09:33:58 -08:00
Wez Furlong d7b55382b4 big initial mux change
This is an unfortunately large diff that:

* Separates Tab ownership from TerminalWindow
* Introduces a Mux container for all of the tabs in the application,
  across all windows
* Moves ownership of processing pty responses to the mux; it sets
  up and has logic to process data for the ptys and apply to the
  tabs

I've moved the logic for processing new tab and new window hotkeys
to the TerminalWindow's themselves as we need some context to
associate the tab with the right window and to create a new window.

I think that will simplify and allow unifying more code.
2019-02-25 00:03:35 -08:00
Wez Furlong 184befae09 adjust double-click selection class
previously this just used unicode word segmentation rules, but that
is insufficient for most technical users.

Change this to look for sequences that are non-whitespace and not
enclosed by bracket/quote delimiters.  This allows selecting file names
with a double click, which was my main issue.
2019-02-24 13:13:35 -08:00
Wez Furlong dba88d2102 clippy 2019-02-24 12:01:08 -08:00
Wez Furlong db5aac6681 implement tabs in the glutin gui system
There's a bunch of code duplication that I want to clean up later.
2019-02-23 13:33:32 -08:00
Wez Furlong 5b126b3f1e Restore fullscreen toggle hotkey and fixup for macos 2019-02-23 13:27:59 -08:00
Wez Furlong b448cfec4d fix shift-insert for paste on linux
the match guard was applying to both arms, so break
this into two separate matches
2019-02-22 20:31:04 -08:00
Wez Furlong c818225a5d ctrl|cmd +/- to manipulate font size with glutin backend
Simliar code needs to be added to the x11 backend in a follow on
commit.

Refs: https://github.com/wez/wezterm/issues/2
2019-02-22 15:22:31 -08:00
Wez Furlong 42fb687759 more fun with keyboard input with glutin/winit
There isn't really any reliable consistency in the virtual_keycodes
being set for simple keys or shifted keys, so we need to go all in
and add our own scancode processing as a fall back.

This makes it even harder to process unicode input, particularly
because we have no idea whether a ReceivedCharacter event will
follow.
2019-02-20 20:30:19 -08:00
Wez Furlong 9f6b21f0db update term to 2018 edition 2019-02-18 23:20:59 -08:00
Wez Furlong 9c9261f332 fix delete on macos 2019-02-18 03:04:48 -08:00
Wez Furlong 1252eaf153 CMD-V -> paste 2019-02-18 02:47:00 -08:00
Wez Furlong 2db17562a6 rustfmt 2019-02-16 00:08:38 -08:00
Wez Furlong 61fec42216 cargo fmt with current stable rustfmt 2018-09-19 20:06:31 -07:00
Wez Furlong 3d3a718182 Fixup phantom release mouse code when using mouse wheel
This was breaking scrolling in vim
2018-09-04 00:34:53 -07:00
Wez Furlong 62d43ddd63 avoid panic when some clients change scroll margins 2018-08-09 00:04:28 -07:00
Wez Furlong 9219dbb327 We can now take iterm images into the wezterm terminalstate
We don't yet have any code to render them, and the vte parser seems
to truncate incoming image sequences ~1kb in size, so more work is
needed to make this useful.
2018-08-08 09:00:07 -07:00
Wez Furlong 2f8ffab213 parse and encode some iTerm specific escape sequences 2018-08-06 01:23:25 -07:00
Wez Furlong dfa3ef5ae6 fix missing paren for the bell print 2018-08-05 17:22:46 -07:00
Wez Furlong a8ae14bb6b fix panic when resizing smaller leaves the cursor off screen 2018-08-05 16:32:29 -07:00
Wez Furlong 60c24a9e41 consolidate on one set of input keycodes and modifiers 2018-08-05 14:28:29 -07:00
Wez Furlong c0ea601645 add helper for managing primary and alt screen 2018-08-05 13:49:03 -07:00
Wez Furlong cee63e74e1 consolidate term::Line -> termwiz::Line 2018-08-05 12:37:01 -07:00
Wez Furlong 2c7a27c42a move CellCluster to termwiz 2018-08-05 12:10:50 -07:00