1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-19 02:37:51 +03:00
Commit Graph

44 Commits

Author SHA1 Message Date
Wez Furlong
f3e42c3d2a point to local filedescriptor crate 2020-01-26 09:15:24 -08:00
Wez Furlong
df58a12827 deps: update to ssh2 0.7.0 2020-01-24 17:49:37 -08:00
Wez Furlong
ffa00bef29 pty: the compiler needed these types for macos
I don't know why this only was a problem on macos, but this fixes
the release build for me on my macos.
2020-01-23 10:50:34 -08:00
Wez Furlong
d84e8531a3 pty: implement awaitable conpty for windows
A bit of a PITA, but it appears to be functional
2020-01-20 15:23:56 -08:00
Wez Furlong
ca836ff95b pty: unix: add awaitable interface 2020-01-20 15:23:55 -08:00
Wez Furlong
118b91bdf6 pty: fix windows build 2020-01-20 08:20:38 -08:00
Wez Furlong
82c824f371 pty: remove conpty support
It's too fiddly to setup in practice, and literally no one has
expressed an interest in using it.

Removing it simplifies some upcoming work.

Closes: https://github.com/wez/wezterm/issues/35
2020-01-20 07:55:51 -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
Jeremy Fitzhardinge
d789748c99 Default to starting tab in home dir if current dir doesn't exist. 2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
31b5798e95 pty: add cwd to CommandBuilder 2020-01-11 18:25:17 -08:00
Wez Furlong
9c9bf6fb97 add CommandBuilder::from_argv 2020-01-07 07:27:02 -08:00
Wez Furlong
52dfce6c4e more mac + windows build tweaks 2019-12-14 22:38:24 -08:00
Wez Furlong
4fdee2baf0 maybe fix the windows build for anyhow changes 2019-12-14 22:27:37 -08:00
Wez Furlong
9a2c7a1485 failure -> anyhow + thiserror 2019-12-14 21:43:05 -08:00
Wez Furlong
cdfd77902a update ssh2 dep 2019-12-08 10:43:55 -08:00
Wez Furlong
6c2fbd43db update ssh2 dep 2019-11-08 18:49:31 -08:00
Wez Furlong
190303c7d5 more explicit dyn for windows 2019-09-23 06:46:56 -07:00
Wez Furlong
986cfcd41a Bump version for publish with ssh support 2019-09-15 18:16:43 -07:00
Wez Furlong
16a17857f6 update to ssh2 0.4.0 2019-09-15 17:54:37 -07:00
Wez Furlong
e818ad9dd1 pty, wezterm: add support for serial ports
Tested only on windows with a USB serial connector to my NUC running
linux.

This allows opening up wezterm on a serial port connection.
Serial is closer to a tty than a pty, so it is a bit different
to configure and use.

This commit allows running:

```
wezterm serial COM3
```

to open a window that connects to the specified COM port.

You can change the baud rate with:

```
wezterm serial --baud 9600 COM3
```

There are more options that could be set, but I'm a bit lazy and
have only exposed the baud rate to the wezterm cli so far.
2019-08-07 10:59:42 -07:00
Wez Furlong
786a4c8551 pty: add concept of "default prog" to the pty layer
Previously we had the logic for this in wezterm itself; it would know
how to figure out which shell to run, or whether we should run a
different program by default (the `default_prog` setting).

This was OK, but when I added support for ssh we hit a conceptual
issue: the local side of the ssh session doesn't have any information
about the shell that should be invoked on the remote side and instead
needs to ask the remote to figure that out.   The interfaces defined
in the code didn't allow for this.

This commit formalizes the concept of a default program and allows
it to be carried through to the pty layer, including over ssh sessions.

Since we now have enough smarts to figure out the local shell and the
local home dir, I've removed the logic that run `login -pf` on macos
by default; this should make the terminal startup very slightly faster
on macos, but since I'm currently on a windows system, I can only test
linux and windows on this side of this commit.  I'll follow up on macos
later.
2019-08-06 15:03:25 -07:00
Wez Furlong
073615ef39 pty: remove some dead code 2019-08-06 14:24:06 -07:00
Wez Furlong
863cf1768a pty: fixup passing term to ssh pty requests 2019-08-06 14:17:03 -07:00
Wez Furlong
acfd712efc pty: fix passing env to windows child processes 2019-08-06 14:11:49 -07:00
Wez Furlong
ca8227a00f use my fork of ssh2 so that we can run properly on windows 2019-08-05 13:40:43 -07:00
Wez Furlong
127b2a567b add wezterm ssh user@host some command
This is mostly useful for folks on Windows, as you can also run
`wezterm start ssh user@host some command` to run the `ssh` binary in a
local pty and let it manage your ssh session.

On Windows the local pty currently breaks mouse reporting
(see https://github.com/microsoft/terminal/issues/376) so it is
desirable to avoid using a local pty if we're going to talk to a
remote system.

This commit makes it a bit more convenient to establish an ad-hoc ssh
session with a pty on a remote host.  This method uses libssh2 under the
covers and thus doesn't support gssapi, which is potentially frustrating
for kerberized environments, but works ok for the majority of users.

There are two issues that I want to resolve in follow up work:

* The TERM has to be sent very early in the channel establishment,
  before we "know" the TERM in the `portable-pty` interface.  Will need to
  figure out how to specify that earlier in an appropriate way.
* Similarly, if no command is specified, we should request the use
  of the shell subsystem but we don't have a way to capture this
  intend with the cmdbuilder. Will need to solve this too.
2019-08-05 09:05:54 -07:00
Wez Furlong
c8aa11ac81 pty: add ssh support
This commit adds (untested!) support for remote ttys over ssh.
It requires that the embedding application connect and authenticate
the ssh session prior to turning it into a PtySystem implementation.
2019-08-02 10:55:04 -07:00
Wez Furlong
9d46bd889f pty: fixup build when serde_support is not enabled 2019-07-23 13:31:01 -07:00
Wez Furlong
23e174a324 fully bump filedescriptor dep 2019-07-23 09:50:48 -07:00
Wez Furlong
7e50c4db68 workaround conpty drop issue 2019-07-17 08:42:41 -07:00
Wez Furlong
2c7138cc6e use consistent version of filedescriptor crate 2019-06-22 14:31:19 -07:00
Wez Furlong
e98d8acb96 add spawn rpc 2019-06-09 08:15:37 -07:00
Wez Furlong
8055957406 clippy 2019-06-09 07:33:00 -07:00
Wez Furlong
5ebad9e63a dyn everywhere 2019-06-08 21:28:11 -07:00
Wez Furlong
5ccff722ef more log 2019-06-08 15:37:55 -07:00
Wez Furlong
f642bd56d6 introduce mux Domain concept
All locations that were setting up ptys now do so via the
Domain concept.  We still need a way to set up a persistent
global domain.
2019-06-04 08:11:55 -07:00
Wez Furlong
fb1a5b42d2 bump filedescriptor crate 2019-06-01 08:23:23 -07:00
Wez Furlong
3bf551706e improve pty example
Example output on linux:

```
child status: ExitStatus { successful: true }
output: wez\r\n%
```

Example output on windows:

```
child status: ExitStatus { successful: true }
output: \u{1b}[2J\u{1b}[?25l\u{1b}[m\u{1b}[HDOMAIN\\wez\u{8}\u{1b}]0;C:\\windows\\system32\\whoami.EXE\u{0}\u{7}\u{1b}[?25h
```

Refs: https://github.com/wez/wezterm/issues/27
2019-05-21 08:58:42 -07:00
Wez Furlong
015a97e2be add pty example that runs whoami
Refs: https://github.com/wez/wezterm/issues/27
2019-05-20 07:20:47 -07:00
Wez Furlong
257c864403 flesh out the crate level docs 2019-05-19 22:35:35 -07:00
Wez Furlong
1d8b024f2f add some doc comments to the pty crate
Refs: https://github.com/wez/wezterm/issues/27
2019-05-19 20:31:07 -07:00
Wez Furlong
c562f35db8 adopt my filedescriptor crate in the pty crate
Refs: https://github.com/wez/wezterm/issues/27
2019-05-19 19:54:12 -07:00
Wez Furlong
7464965d1e fixup windows build for pty mod -> crate move
Refs: https://github.com/wez/wezterm/issues/27
2019-05-19 18:55:10 -07:00
Wez Furlong
7bf1d99d77 move pty to its own crate in preparation for publishing
Refs: https://github.com/wez/wezterm/issues/27
2019-05-19 18:40:26 -07:00