1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 07:46:59 +03:00
Commit Graph

193 Commits

Author SHA1 Message Date
Wez Furlong
99919dc807 implement answerback for osc 4, 10-18
These codes are used to change the color palette, but if the `?`
string is used in place of a color spec, then we must respond with
the current color value string for that palette entry, so lets
implement that!
2019-06-02 12:19:58 -07:00
Wez Furlong
8f8d03fc05 support osc 10-19 dynamic color changing 2019-06-01 21:47:25 -07:00
Wez Furlong
276e9aef91 osc 4 accepts multiple parameters 2019-06-01 19:59:44 -07:00
Wez Furlong
4193442ec8 make OSC 4 actually change the palette 2019-06-01 16:15:37 -07:00
Wez Furlong
6e4db86f7e add palette to the terminal state 2019-06-01 15:55:08 -07:00
Wez Furlong
d18dbe9ff7 parse OSC 4
This code is used to change the color palette at runtime.
We can parse it but not do anything useful with it yet.
2019-06-01 15:39:46 -07:00
Wez Furlong
98bd82e212 bump some deps 2019-05-27 20:08:30 -07:00
Wez Furlong
0bb3714435 improve double-click selection of wrapped lines
This one has been bugging me for a while; we now know when we've
wrapped a line and can join it without a line break when double-clicking
to select a word.

This commit introduces a wrapped attribute to help record this
information, which could potentially help with when it comes
to looking at nicer resize behavior in refs: https://github.com/wez/wezterm/issues/14
2019-05-26 16:05:51 -07:00
Wez Furlong
09f168a0db plumbing for double click selection of wrapped lines 2019-05-26 14:52:03 -07:00
Wez Furlong
038100922a clippy 2019-05-26 12:49:10 -07:00
Wez Furlong
607e180122 Range::contains is now stable; use it. 2019-05-26 11:40:33 -07:00
Wez Furlong
f87901c484 tidy up some failure usage 2019-05-26 08:58:59 -07:00
Wez Furlong
8a76f27f9b remove some extern crates
These got overlooked when migrating from 2015->2018 edition syntax.
2019-05-26 08:27:43 -07:00
Wez Furlong
b83656b378 bump image crate dep
This avoids compiling two different versions of image
2019-05-26 08:13:24 -07:00
Mark Thomas
fb636995c8 separate application cursor keys
Application cursor keys are a separate set of encodings that applications can
ask the terminal to produce for cursor keys.

Unfortunately, PuTTY generates these for shift-modified cursor keys.  If an
application is to distinguish between normal and shift-modified cursor keys
on PuTTY then it will need to be able to distinguish between normal and
application cursor keys.

Add new `KeyCode` variants for application cursor keys.
2019-05-18 09:12:46 -07:00
Wez Furlong
acc895f1cd avoid deadlock while pasting large chunks of text
A big paste could saturate the input/output of the pty and
lead to an effective deadlock; the application wants to send
output to us but we are busy trying to write the paste to it.

Break up large pastes into chunks and send them piece by piece.
This does mean that a large bracketed paste is not an atomic
unit any longer, but it seems to work out ok when pasting into
vim.
2019-03-23 15:25:49 -07:00
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