forked from KevinSilvester/wezterm-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdomains.lua
More file actions
65 lines (55 loc) · 1.84 KB
/
Copy pathdomains.lua
File metadata and controls
65 lines (55 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
local platform = require('utils.platform')
local wezterm = require 'wezterm'
local options = {
-- ref: https://wezfurlong.org/wezterm/config/lua/SshDomain.html
ssh_domains = {},
-- ref: https://wezfurlong.org/wezterm/multiplexing.html#unix-domains
unix_domains = {},
-- ref: https://wezfurlong.org/wezterm/config/lua/WslDomain.html
wsl_domains = {},
}
for host, config in pairs(wezterm.enumerate_ssh_hosts()) do
table.insert(options.ssh_domains, {
-- the name can be anything you want; we're just using the hostname
name = host,
-- remote_address must be set to `host` for the ssh config to apply to it
remote_address = host,
-- if you don't have wezterm's mux server installed on the remote
-- host, you may wish to set multiplexing = "None" to use a direct
-- ssh connection that supports multiple panes/tabs which will close
-- when the connection is dropped.
-- multiplexing = "None",
-- if you know that the remote host has a posix/unix environment,
-- setting assume_shell = "Posix" will result in new panes respecting
-- the remote current directory when multiplexing = "None".
assume_shell = 'Posix',
})
end
if platform.is_win then
options.ssh_domains = {
{
name = 'ssh:wsl',
remote_address = 'localhost',
multiplexing = 'None',
default_prog = { 'fish', '-l' },
assume_shell = 'Posix',
},
}
options.wsl_domains = {
{
name = 'wsl:ubuntu-fish',
distribution = 'Ubuntu',
username = 'kevin',
default_cwd = '/home/kevin',
default_prog = { 'fish', '-l' },
},
{
name = 'wsl:ubuntu-bash',
distribution = 'Ubuntu',
username = 'kevin',
default_cwd = '/home/kevin',
default_prog = { 'bash', '-l' },
},
}
end
return options