2018-02-07 08:32:40 +03:00
|
|
|
# Wez's Terminal
|
|
|
|
|
|
|
|
A terminal emulator implemented in Rust.
|
|
|
|
|
|
|
|
## Quickstart
|
|
|
|
|
2018-02-07 08:55:52 +03:00
|
|
|
* Install `rustup` to get the *nightly* `rust` compiler installed on your system.
|
2018-02-07 08:32:40 +03:00
|
|
|
https://www.rust-lang.org/en-US/install.html
|
|
|
|
* Build in release mode: `cargo build --release`
|
|
|
|
* Run it via either `cargo run --release` or `target/release/wezterm`
|
|
|
|
|
2018-02-07 09:24:36 +03:00
|
|
|
You will need a collection of support libraries; important to note is that
|
|
|
|
your `harfbuzz` library must have support for `hb_ft_font_create_referenced`;
|
|
|
|
older linux distributions don't have this!
|
|
|
|
|
|
|
|
```
|
|
|
|
$ sudo apt-get install -y libxcb-icccm4-dev libxcb-ewmh-dev \
|
|
|
|
libxcb-image0-dev libxcb-keysyms1-dev libharfbuzz-dev \
|
|
|
|
libfontconfig1-dev libfreetype6-dev
|
|
|
|
```
|
2017-12-07 19:20:29 +03:00
|
|
|
|
|
|
|
## What?
|
|
|
|
|
|
|
|
Here's what I'm shooting for:
|
|
|
|
|
|
|
|
* A terminal escape sequence parser
|
2018-02-07 08:32:40 +03:00
|
|
|
* A model of a terminal screen + scrollback that is OS independent
|
|
|
|
* Textual and GUI rendering of the model
|
|
|
|
* A differential protocol for the model
|
2017-12-07 19:20:29 +03:00
|
|
|
|
|
|
|
This would manifest as a common core that could run as both a textual
|
|
|
|
terminal multiplexer and a gui terminal emulator, where the GUI part
|
|
|
|
could automatically provide a native UI around the remotely multiplexed
|
|
|
|
terminal session.
|
|
|
|
|
2018-02-07 08:32:40 +03:00
|
|
|
## Status / Features
|
|
|
|
|
|
|
|
These are in the done/doing soon category:
|
|
|
|
|
|
|
|
- [x] Runs on Linux with XCB
|
|
|
|
- [x] Scrollback (use mouse wheel and Shift Page{Up|Down})
|
|
|
|
- [x] True Color support
|
2018-02-07 18:51:04 +03:00
|
|
|
- [x] Color Emoji and font fallback
|
2018-02-08 07:18:24 +03:00
|
|
|
- [x] Paste selection via Shift-Insert (bracketed paste is supported!)
|
|
|
|
- [x] SGR style mouse reporting (works in vim and tmux)
|
2018-02-10 02:47:41 +03:00
|
|
|
- [x] xterm style selection of text with mouse
|
2018-02-11 08:42:55 +03:00
|
|
|
- [x] Render underline, italic, bold, strikethrough
|
2018-02-07 18:53:51 +03:00
|
|
|
- [ ] Configuration file to specify fonts and colors (in progress)
|
2018-02-07 09:48:28 +03:00
|
|
|
- [ ] Command line argument parsing instead of launching user shell
|
2018-02-10 02:47:41 +03:00
|
|
|
- [ ] Hyperlinks see: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
|
2018-02-07 08:32:40 +03:00
|
|
|
|
|
|
|
There's a good number of terminal escape sequences that are not yet implemented
|
|
|
|
and that will get fleshed out as the applications I use uncover them.
|
|
|
|
Similarly for key mappings.
|
|
|
|
|
|
|
|
Things that I'd like to see happen and that have no immediate priority
|
|
|
|
(contributions to get closer to these are welcomed!)
|
|
|
|
|
|
|
|
- [ ] Runs on macOS
|
2018-02-10 02:47:41 +03:00
|
|
|
- [ ] Sixel / iTerm2 graphics protocol support
|
2018-02-07 08:32:40 +03:00
|
|
|
- [ ] Tabs
|
|
|
|
- [ ] Textual renderer. Think `tmux` or `screen`.
|
2018-02-08 07:18:24 +03:00
|
|
|
- [ ] Runs on Linux with Wayland (use XWayland for now)
|
2018-02-07 08:32:40 +03:00
|
|
|
- [ ] Runs on Windows
|
2018-02-07 18:51:04 +03:00
|
|
|
|
2018-02-10 02:47:41 +03:00
|
|
|
|
2018-02-07 18:51:04 +03:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
`wezterm` will look for a TOML configuration file in `$HOME/.config/wezterm/wezterm.toml`,
|
|
|
|
and then in `$HOME/.wezterm.toml`.
|
|
|
|
|
|
|
|
Configuration is currently very simple and the format is considered unstable and subject
|
2018-02-10 19:43:36 +03:00
|
|
|
to change. The code for configuration can be found in [`src/config.rs`](src/config.rs).
|
2018-02-07 18:51:04 +03:00
|
|
|
|
|
|
|
I use the following in my `~/.wezterm.toml`:
|
|
|
|
|
|
|
|
```
|
|
|
|
font_size = 10
|
2018-02-08 07:18:24 +03:00
|
|
|
font = { fontconfig_pattern = "Operator Mono SSm Lig Medium" }
|
2018-02-10 20:43:54 +03:00
|
|
|
# How many lines of scrollback to retain
|
|
|
|
scrollback_lines = 3500
|
2018-02-07 20:23:24 +03:00
|
|
|
|
|
|
|
[[font_rules]]
|
|
|
|
italic = true
|
2018-02-08 07:18:24 +03:00
|
|
|
font = { fontconfig_pattern = "Operator Mono SSm Lig Medium:style=Italic" }
|
|
|
|
|
|
|
|
[[font_rules]]
|
|
|
|
italic = true
|
|
|
|
intensity = "Bold"
|
|
|
|
font = { fontconfig_pattern = "Operator Mono SSm Lig:style=Italic:weight=bold" }
|
|
|
|
|
|
|
|
[[font_rules]]
|
|
|
|
intensity = "Bold"
|
2018-02-10 19:36:34 +03:00
|
|
|
[font_rules.font]
|
|
|
|
fontconfig_pattern= "Operator Mono SSm:weight=bold"
|
2018-02-10 19:37:40 +03:00
|
|
|
# if you liked xterm's `boldColor` setting, this is how you do it in wezterm,
|
|
|
|
# but you can apply it to any set of matching attributes!
|
2018-02-10 19:36:34 +03:00
|
|
|
foreground = "tomato"
|
2018-02-08 07:18:24 +03:00
|
|
|
|
|
|
|
[[font_rules]]
|
|
|
|
intensity = "Half"
|
|
|
|
font = { fontconfig_pattern = "Operator Mono SSm Lig Light" }
|
2018-02-07 18:51:04 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
The default configuration will attempt to use whichever font is returned from
|
|
|
|
fontconfig when `monospace` is requested.
|
2018-02-10 19:16:20 +03:00
|
|
|
|
|
|
|
### Colors
|
|
|
|
|
|
|
|
You can configure colors with a section like this. In addition to specifying
|
|
|
|
SVG/CSS3 color names, you can use `#RRGGBB` to specify a color code using the
|
2018-02-10 19:42:10 +03:00
|
|
|
usual hex notation; eg: `#000000` is equivalent to `black`:
|
2018-02-10 19:16:20 +03:00
|
|
|
|
|
|
|
```
|
|
|
|
[colors]
|
|
|
|
foreground = "silver"
|
|
|
|
background = "black"
|
|
|
|
cursor = "springgreen"
|
|
|
|
ansi = ["black", "maroon", "green", "olive", "navy", "purple", "teal", "silver"]
|
|
|
|
brights = ["grey", "red", "lime", "yellow", "blue", "fuchsia", "aqua", "white"]
|
|
|
|
```
|