1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-11 03:27:05 +03:00
Commit Graph

205 Commits

Author SHA1 Message Date
Wez Furlong
58eb8e3614 wezterm-font: move caching of freetype font size into Face
Profiling showed that set_font_size was a hotspot.  While there was
caching of the size info at the shaper layer, it was also needed in
the raster layer, so move it into the raster layer from the shaper
layer.

refs: #353
2020-11-25 09:20:14 -08:00
Wez Furlong
aaf63285d2 tmux: attach control mode parser to terminal
This causes `tmux -CC attach` to enter control mode and patch
into the terminal, printing out parsed event messages.

refs: https://github.com/wez/wezterm/issues/336
2020-11-20 09:24:50 -08:00
Wez Furlong
ec55a23398 tmux: add tmux-cc crate
This crate knows how to parse data returned from the `tmux -CC` protocol.

refs: https://github.com/wez/wezterm/issues/336
2020-11-20 09:24:28 -08:00
Wez Furlong
7e8c5a06bb split gui into wezterm-gui executable
This commit moves a bunch of stuff around such that `wezterm` is now a
lighter-weight executable that knows how to spawn the gui, talk to
the mux or emit some escape sequences for imgcat.

The gui portion has been moved into `wezterm-gui`, a separate executable
that doesn't know about the CLI or imgcat functionality.

Importantly, `wezterm.exe` is no longer a window subsystem executable
on windows, which makes interactions such as `wezterm -h` feel more
natural when spawned from `cmd`, and should allow
`type foo.png | wezterm imgcat` to work as expected.

That said, I've only tested this on linux so far, and there's a good
chance that something mac or windows specific is broken by this
change and will need fixing up.

refs: #301
2020-10-24 16:40:15 -07:00
Wez Furlong
75dca6e972 move strip-ansi-escapes into its own crate 2020-10-03 11:15:57 -07:00
Wez Furlong
faba4d9074 move gui into wezterm crate/binary 2020-10-03 11:15:57 -07:00
Wez Furlong
0c32963f1c Move server to its own wezterm-mux-server binary 2020-10-03 11:15:57 -07:00
Wez Furlong
a07004302a move codec into is own crate 2020-10-03 11:15:57 -07:00
Wez Furlong
a511abb1c2 move mux to its own crate 2020-10-03 11:15:57 -07:00
Wez Furlong
5fc1227fb9 move ratelim to its own crate 2020-10-03 11:15:57 -07:00
Wez Furlong
ee6864c217 move config into its own crate 2020-10-03 11:15:57 -07:00
Wez Furlong
d64dab2a2b move lua helpers into own crate 2020-10-03 11:15:57 -07:00
Wez Furlong
e6a858664f windows: Software frontend is now mesa llvmpipe
This is a bit of a switch-up, see this comment for more background:
refs: https://github.com/wez/wezterm/issues/265#issuecomment-701882933

This commit:

* Adds a pre-compiled mesa3d opengl32.dll replacement
* The mesa dll is deployed to `<appdir>/mesa/opengl32.dll` which by
  default is ignored.
* When the frontend is set to `Software` then the `mesa` directory
  is added to the dll search path, causing the llvmpipe renderer
  to be enabled.
* The old software renderer implementation is available using the
  `OldSoftware` frontend name

I'm not a huge fan of the subdirectory for the opengl32.dll, but
I couldn't get it to work under a different dll name; the code
thought that everything was initialized, but the window just rendered
a white rectangle.
2020-10-01 18:31:57 -07:00
Wez Furlong
c2c788b41d bintree: introduce a binary tree + zipper impl
The intent is for this to help manage panes, but it is reasonably
general purpose so it is broken out separately.
2020-09-20 08:27:44 -07:00
Wez Furlong
d4a01fa538 wezterm: bump lru dep 2020-07-08 23:44:40 -07:00
Luben Karavelov
5a76302c84 Update to allsorts-0.4 2020-06-20 12:31:11 -07:00
Wez Furlong
3f04ce3bba wezterm: remove unused failure deps, bump lazy_static 2020-06-16 17:27:06 -07:00
Wez Furlong
8250f9e4cf wezterm: set a reasonable default LANG on macos
If LANG isn't set then ask NSLocale for the language and country code
and see if we can conjure up a valid UTF-8 locale name.  If so,
export that in the LANG environment for our children to inherit.

refs: https://github.com/wez/wezterm/issues/220
refs: https://github.com/wez/wezterm/issues/216
2020-06-13 20:41:52 -07:00
Wez Furlong
e70a58e7f3 cargo update 2020-06-13 10:21:49 -07:00
Wez Furlong
24fdf27d65 misc: upgrade unicode-segmentation 2020-06-13 10:10:34 -07:00
Wez Furlong
2f3a508e99 term: make serde optional 2020-06-13 10:04:20 -07:00
Wez Furlong
d547d938d8 term: rename crate to wezterm-term in advance of publishing
Add some more docs and remove a couple of dead bits of code.
2020-06-13 09:55:16 -07:00
Wez Furlong
d660f53f86 wezterm: render release notes as markdown in the update UI
This adds a markdown -> termwiz render helper for the update UI
to make the release notes look a bit more intelligible.
2020-06-06 06:33:54 -07:00
Wez Furlong
82261ff16d wezterm: enable scrollback in the error window
This commit doesn't do anything specific to scrollback though!
It moves the implementation of the TermWizTermTab away from
a directly manipulated Surface and over to using the term::Terminal,
making the renderer look more like the one used by the local tab
and domain implementation.

As a side effect of doing this, we get scrollback management
for free.

refs: https://github.com/wez/wezterm/issues/201
2020-06-03 08:45:03 -07:00
Wez Furlong
3468896ec1 wezterm: generate version info resource at build time
Bake in the git version info
2020-05-25 12:36:29 -07:00
Wez Furlong
845d990304 add strip-ansi-escape utility to wezterm package
I've been meaning to do this for a while: the intended purpose
is to use this to filter ansi escape sequences out of the prompt
in the shell pre-command hook.
2020-05-17 21:51:07 -07:00
Wez Furlong
d39c16c406 wezterm: check for new releases
This commit adds some plumbing that will use the github API to
probe the currently released version of wezterm, and if it is
newer than the running version, show a window with some release
information and links to the changelog and download page.

The checks can be disabled in the config (but require a restart
to take effect!) and default to checking every 24 hours.

If running an AppImage on linux, links directly to the appimage
download.  In the future I'd like to have the download button
use zsync to apply the update to the local image.
2020-05-08 22:18:31 -07:00
Wez Furlong
4858194ef4 wezterm: lua: add glob and read_dir
These functions are useful when dynamically constructing configuration.
2020-04-11 19:21:52 -07:00
Wez Furlong
5f13e487ce lua: give a nice error message when using an invalid field name
Make a reasonable suggestion to the user based on similarity with
possible field names, but don't error out.

This facilitates evolving the configuration over time, and makes
the config more forgiving of typos.
2020-03-01 09:39:14 -08:00
Wez Furlong
fa01ca59ca lua: add serde-powered to_lua_value function
This will help in implementing lua helper functions for various
config and other structures.
2020-02-29 21:46:59 -08:00
Wez Furlong
ab03147bd9 config: we can now read ~/.wezterm.lua
This allows for slightly more fancy configuration in the future, but for
now it is rather simple: your lua script returns a configuration struct
with the same shape as that from the TOML file.

A `wezterm` module is provided to the script that provides some
constants to help understand the environment in which wezterm
is running.

I want to add some helpers that make setting up the fonts feel less
weird (lots of nesting in the data model makes this weird).

The ability to conditionally construct configuration is powerful
and helps to address the broader request in
refs: https://github.com/wez/wezterm/issues/152

An example config looks like this:

```lua
local wezterm = require 'wezterm';

print(wezterm.config_dir);
print(wezterm.executable_dir);
wezterm.log_error("w00t! running " .. wezterm.version
  .. " on " .. wezterm.target_triple ..  " " .. wezterm.home_dir);

return {
  enable_scroll_bar = true,
  enable_tab_bar = true,
  ratelimit_output_bytes_per_second = 400000,
  scrollback_lines = 350000,
  font_dirs = {".dotfiles/fonts"},

  window_padding = {
    left = 2,
    bottom = 2,
  },

  font = {
    font = {{
      family = "Operator Mono SSm Lig Medium",
    }},
  },

  unix_domains = {
    {
      name = "unix",
    }
  },

  ssh_domains = {
    {
      name = "localhost",
      remote_address = "localhost",
      username = "wez",
    },
  },

  tls_clients = {
    {
      name = "cubetls",
      remote_address = "cube-localdomain:8080",
      bootstrap_via_ssh = "cube-localdomain",
    },
  },

  tls_servers = {
    {
      bind_address = "192.168.1.8:8080",
    },
  },

  hyperlink_rules = {
    {
      regex = "\\b\\w+://(?:[\\w.-]+)\\.[a-z]{2,15}\\S*\\b",
      format = "$0",
    },
  },

  font_rules= {
    {
      italic = true,
      font = {
        font = {{
          family = "Operator Mono SSm Lig Medium Italic",
        }}
      },
    },

    {
      italic = true,
      intensity = "Bold",
      font = {
        font = {{
          family = "Operator Mono SSm Lig Book Italic",
        }}
      },
    },

    {
      intensity = "Bold",
      font = {
        foreground = "tomato",
        font = {{
          family = "Operator Mono SSm Lig Bold",
        }}
      },
    },

    {
      intensity = "Half",
      font = {
        font = {{
          family = "Operator Mono SSm Lig Light",
        }}
      },
    },
  },
}
```
2020-02-26 22:11:23 -08:00
Wez Furlong
18294841e9 ssh2: update to 0.8
That version has the ability to use SSH agent forwarding.
This commit doesn't enable that functionality, it's just updating
the version and adjusting for changes in the upstream.
2020-02-22 08:50:13 -08:00
Wez Furlong
1357a7f25a Enable timestamps in the logger 2020-02-14 09:46:19 -08:00
Jun Wu
f51650c891 termwiz: remove dep on palette
The palette crate has a codegen step that translates svg_colors.txt to named.rs.
That makes it hard to build using buck.

Remove the palette dependency so termwiz is easier to build using buck.

I made sure the following code:

    fn main() {
        use termwiz::color::RgbColor;
        let r = RgbColor::from_rgb_str("#02abcd").unwrap();
        let r1 = r.to_tuple_rgba();
        let r2 = r.to_linear_tuple_rgba();
        println!("r1 = {:?}", r1);
        println!("r2 = {:?}", r2);
    }

prints

    r1 = (0.007843138, 0.67058825, 0.8039216, 1.0)
    r2 = (0.000607054, 0.4072403, 0.6104956, 1.0)

before and after the change.
2020-02-11 07:45:50 -08:00
Wez Furlong
cb9ec2fa2a biffed: native_tls
We use openssl on all platforms now
2020-02-02 13:03:07 -08:00
Wez Furlong
274d22edda tls: revisit cargo features
This commit adjusts the features in Cargo.toml to allow building
without openssl on unix systems.

It teaches the native_tls flavor of the code to perform bootstrapping
via ssh, but is still not usable because there still isn't a way
to get native_tls to use PEM files.
2020-02-02 13:03:07 -08:00
Wez Furlong
28243b2a32 mux: sound groundwork for auto pki
This is a step towards automatic management of TLS certs for the
mux stuff.
2020-02-02 13:03:07 -08:00
Wez Furlong
f3e42c3d2a point to local filedescriptor crate 2020-01-26 09:15:24 -08:00
Wez Furlong
fd8f28960f ssh: use a single window for authenticating a session
This makes it so that we preserve context while showing the connection
status and authentication prompts.
2020-01-25 13:00:16 -08:00
Wez Furlong
a1b9d04709 Update structopt to 0.3 2020-01-24 21:49:42 -08:00
Wez Furlong
df58a12827 deps: update to ssh2 0.7.0 2020-01-24 17:49:37 -08:00
Wez Furlong
894e971e25 Show a window with the full error message for failed config load
This is a very basic first approximation for the feature discussed
in the associated github issue.

Refs: https://github.com/wez/wezterm/issues/80
2020-01-17 18:47:02 -08:00
Wez Furlong
7de282fd07 mux: make Domain::attach an async fn 2020-01-16 15:55:15 -08:00
Wez Furlong
62f0f7a273 adopt async-task for muxserver task runner
This simplifies some of its code
2020-01-16 01:03:32 -08:00
Wez Furlong
256b4e6da8 fix pollable_channel to be non-blocking on Windows
Upgrade filedescriptor to 0.7 to use the portable helper for
setting non-blocking mode, and enable non-blocking mode on Windows.
2020-01-15 21:30:14 -08:00
Wez Furlong
4b455288dd track the full current dir URL for OSC 7
Matching against the current dir when it includes a host and a
path seems like a handy way to automate selecting appropriate
theme/color/profile settings, so I'd like to make sure that
we have the full URL content available for that.

Refs: https://github.com/wez/wezterm/issues/115
Refs: https://github.com/wez/wezterm/issues/117
2020-01-14 22:06:13 -08:00
Wez Furlong
ad2f724416 bump some versions 2020-01-09 22:39:34 -08:00
Wez Furlong
94cac23df9 Workaround daemonize bug
refs: https://github.com/knsd/daemonize/pull/39
2020-01-05 20:55:28 -08:00
Wez Furlong
d79455c2b4 switch most of the rest of the mux over to the new model
This mostly works, but has a cache invalidation issue wrt.
passing invalidated rows from the server to the client...
sometimes.

However, scrollback is cached on demand and selection works.
2020-01-05 14:37:17 -08:00
Wez Furlong
60e05dbe95 add RangeSet type
The idea is to use this to maintain a set of dirty StableRowIndex
values for the mux rpc.
2020-01-05 14:37:17 -08:00