1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-02 23:55:11 +03:00
Commit Graph

133 Commits

Author SHA1 Message Date
Wez Furlong
7c7825c070 term: extract configuration to a trait
This isn't complete but begins the process of extracting
the embedding application configuration into a trait provided
by the application rather than passing the values in at
construction.

This allows the application to change configuration at
runtime.

The first option to handle this is the scrollback size.
2019-11-24 12:43:41 -08:00
Wez Furlong
ac7a509dbb allow configuring the tab bar
The defaults are pretty neutral.  You can get a little more fancy
with something like this:

```
[colors.tab_bar]
background = "#0b0022"

[colors.tab_bar.active_tab]
bg_color = "#2b2042"
fg_color = "#c0c0c0"

[colors.tab_bar.inactive_tab]
bg_color = "#1b1032"
fg_color = "#808080"

[colors.tab_bar.inactive_tab_hover]
bg_color = "#3b3052"
fg_color = "#909090"
italic = true
```
2019-11-21 00:04:49 -08:00
Wez Furlong
d397976acf fix rendering of the cursor position in the line editor 2019-11-16 13:58:01 -08:00
Wez Furlong
6289c08a4e Adopt CSI u modifier encoding for keypresses
See http://www.leonerd.org.uk/hacks/fixterms/ for the specification.

Refs: https://github.com/wez/wezterm/issues/63
2019-11-16 13:38:03 -08:00
Wez Furlong
7323e30be7 try to normalize the shift state in the keymap handling code
We weren't recognizing ctrl+shift+c for example on linux.
2019-11-11 09:11:52 -08:00
Wez Furlong
a26cab3833 add wezterm imgcat subcommand to output images to the terminal
This subcommand parses its input and outputs an iTerm2 compatible
img escape sequence (https://iterm2.com/documentation-images.html)

Usage is straightforward:

```
$ wezterm imgcat  assets/windows/terminal.ico --width "10%" --height "10%"
```
2019-11-09 15:50:59 -08:00
Wez Furlong
6da7b3ecd0 internalized password/auth UI for ssh
This is a bit of a large commit because it needed some plumbing:

* Change mux creation to allow deferring associating any domains,
  and to change the default domain later in the lifetime of the
  program
* De-bounce the empty mux detection to allow for transient windows
  during early startup
* Implement a bridge between the termwiz client Surface and the
  frontend gui renderer so that we can render from termwiz to
  the gui.
* Adjust the line editor logic so that the highlight_line method
  can change the length of the output.  This enables replacing
  the input text with placeholders so that we can obscure password
  input
2019-11-08 19:55:12 -08:00
Wez Furlong
1ab438c1e2 improve emoji width calculation
I noticed while scrolling `emoji-test.txt` that some of the combined
emoji sequences rendered very poorly.  This was due to the unicode
width being reported as up to 4 in some cases.

Digging into it, I discovered that the unicode width crate uses a
standard calculation that doesn't take emoji combination sequences
into account (see https://github.com/unicode-rs/unicode-width/issues/4).

This commit takes a dep on the xi-unicode crate as a lightweight way
to gain access to emoji tables and test whether a given grapheme is
part of a combining sequence of emoji.
2019-11-05 08:45:08 -08:00
Wez Furlong
a9bdca6d84 bump up to latest unicode segmentation crate 2019-11-04 22:12:21 -08:00
Wez Furlong
23b4876d75 fix an issue with utf-8 in OSC sequences
I've noticed this off and on for a while, and thought it was something
fishy with my shell dotfiles.

Tracing through I found that the final byte in the "Face with head
bandage" emoji 🤕 U+1F915 was being interpreted as the MW control
code and causing the vt parser to jump out of the OSC state.

The solution for this is to hook up proper UTF-8 processing in the
same way that it is applied in the ground state.

Since we don't have enough bits to introduce new state values (we're
pretty tightly packed in the 16 bits available), I've introduced a
memory of the state to which the utf8 parser needs to return once
a complete sequence is detected.
2019-11-03 22:01:35 -08:00
Wez Furlong
c3d8f26e3e fix test case
refs: https://github.com/wez/wezterm/issues/52
2019-10-28 00:14:19 -07:00
Wez Furlong
d80169ceff Avoid accidental application mode delete output in key processing
I thought that I'd broken something with the DEL processing in vim with
the new frontend but it turned out that the other frontend was emitting
BS always and that I'd actuall unbroken passing DEL through and that
other layers were translating DEL into an application cursor mode output
for DEL that emits a totally different sequence.

This diff preserves DEL and disables that other sequence.

Will follow up with some explicit configuration to control this
behavior, but in the short term, the default behavior should be much
closer to what people actually want and expect!

refs: https://github.com/wez/wezterm/issues/52
2019-10-27 23:59:15 -07:00
Wez Furlong
d97a84f984 render iterm2 image protocol in the software renderer
This is still a bit rough because the terminal parser doesn't
understand the pixel sizes, so it relies on the hard coded
cell dimensions being accurate.
2019-10-26 23:30:39 -07:00
Wez Furlong
52a65370fa cargo fmt with rust 1.38 2019-09-28 21:40:40 -07:00
Wez Furlong
950a7d2b22 cargo fix dyn 2019-09-28 20:29:48 -07:00
Wez Furlong
23e174a324 fully bump filedescriptor dep 2019-07-23 09:50:48 -07:00
Wez Furlong
6ace6d4fcc avoid a panic when resizing a muxed tab as the first event 2019-07-16 09:34:51 -07:00
Wez Furlong
d18383416e termwiz: update version
This pulls in the new vtparse crate and publishes Mark's new
API in the termwiz parser.
2019-06-29 19:20:11 -07:00
Wez Furlong
5440cbe521 replace vte with our own vtparse crate
This enables using large OSC buffers in a form that we can publish
to crates.io without blocking on an external crate.  Large OSC
buffers are important both for some tunnelling use cases and for
eg: iTerm2 image protocol handling.
2019-06-29 16:28:39 -07:00
Wez Furlong
2361d88c2a initial take on a low level vt parser
This is based on the state machine described by
https://vt100.net/emu/dec_ansi_parser

and the public domain C implementation:
https://github.com/haberman/vtparse
2019-06-29 15:21:09 -07:00
Mark Thomas
dbb0bd565e add parse_first_as_vec
Add a convenience function to the escape parser that, like `parse_first`,
matches only the first escape sequence, but instead collects all matching
actions.
2019-06-25 06:44:30 -07:00
Wez Furlong
2c7138cc6e use consistent version of filedescriptor crate 2019-06-22 14:31:19 -07:00
Wez Furlong
cb4fa1ac21 get_dirty_lines now uses Cow<Line>
This avoids some extra allocations in the local tab case.
2019-06-22 06:57:35 -07:00
Wez Furlong
97daa8b246 switch to using the poll stuff from filedescriptor 0.3 2019-06-19 00:01:35 -07:00
Wez Furlong
b58d329b07 some plumbing to use Surface+Change for the mux protocol 2019-06-16 21:04:53 -07:00
Wez Furlong
01a8c32b55 unblock tunneled mux protocol work
It's taking a while for https://github.com/jwilm/vte/pull/20 to get
merged, so point to my branch directly while I build out some
tunneled mux protocol escape sequences.

I'll need to fork vte on crates.io if vte doesn't merge the PR
before the next termwiz crate bump.
2019-06-13 06:57:10 -07:00
Wez Furlong
86cd39eb4e we can now send input to a client tab 2019-06-09 16:33:57 -07:00
Wez Furlong
8055957406 clippy 2019-06-09 07:33:00 -07:00
Wez Furlong
5ccff722ef more log 2019-06-08 15:37:55 -07:00
Wez Furlong
3b94cddf8e allow specifying key bindings in wezterm.toml
refs: https://github.com/wez/wezterm/issues/32
2019-06-08 08:28:34 -07:00
Wez Furlong
e9780d6a34 termwiz: bump version for crates.io/streampager 2019-06-02 21:00:26 -07:00
Wez Furlong
43fcca6343 termwiz: ensure that the tty is in blocking mode
Refs: https://github.com/markbt/streampager/issues/1
Refs: https://github.com/markbt/streampager/issues/3
2019-06-02 20:36:01 -07:00
Wez Furlong
c0e3bdfb70 termwiz: avoid emitting a wake event on a spurious pipe wakeup 2019-06-02 18:27:15 -07:00
Wez Furlong
ae303fea56 termwiz: avoid emitting a resize event on a spurious sigwinch read 2019-06-02 18:11:07 -07:00
Wez Furlong
d000938fef emulate poll(2) on macos using select(2)
Refs: https://github.com/wez/wezterm/issues/31
2019-06-02 16:15:17 -07:00
Wez Furlong
090c24554f introduce our own poll function
This is just a minor refactoring at this stage

Refs https://github.com/wez/wezterm/issues/31
2019-06-02 14:53:07 -07:00
Wez Furlong
00c1000caa bump termwiz version for crates.io 2019-06-02 13:55:25 -07:00
Mark Thomas
70741d4f80 set underline and blink in fallback path
pull/29 inadvertently removed the fallback path for setting single
underline and slow blink.  Restore it.
2019-06-02 13:55:07 -07:00
Mark Thomas
3f16979067 clean up flush_pending_attr
The `flush_pending_attr` method does lots of unnecessary comparisons.
If the attributes have changed, then it works by resetting the
attributes and then setting new values.  There's no need to emit the
codes for exiting modes.

It also doesn't support double underscore or rapid blink in the cases
where the terminfo capabilities are used, as these capabilities can't
express these attributes.  Fall back to CSI sequences when these
attributes are requested.
2019-06-02 12:41:46 -07:00
Mark Thomas
90689d4406 set colors after resetting attributes
Changing the terminal attributes (bold, underline, etc.) involves
emitting the `exit_attribute_mode` or SGR reset sequence.  This also
resets the colors back to their defaults.  If this happens when the
foreground or background colors haven't changed, set the colors again.
2019-06-02 12:41:46 -07:00
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
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
fb1a5b42d2 bump filedescriptor crate 2019-06-01 08:23:23 -07:00
Wez Furlong
906aa0c95c termwiz: use filedescriptor crate instead of RawHandle bits 2019-06-01 07:43:06 -07:00
Wez Furlong
38adc117f4 termwiz: use filedescriptor crate instead of RawFd bits 2019-05-31 22:52:40 -07:00
Wez Furlong
3c6552b975 cargo publish wants a.b.c rather than a.b for package.version 2019-05-27 20:09:33 -07:00
Wez Furlong
98bd82e212 bump some deps 2019-05-27 20:08:30 -07:00
Wez Furlong
91ea7cd576 add keywords 2019-05-27 19:57:44 -07:00