File tree 2 files changed +36
-6
lines changed
2 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 5
5
} : let
6
6
inherit ( config ) xdg home ;
7
7
in {
8
+ xdg . configFile . "wezterm/workspace.yaml" . source = pkgs . writeText "workspace.yaml" ''
9
+ windows:
10
+ - command: direnv exec . hx .
11
+ name: editor
12
+ restart: true
13
+ panes:
14
+ - size: 0.20
15
+ name: term
16
+ direction: Bottom
17
+ split_from: 1
18
+ '' ;
8
19
xdg . configFile . "wezterm/wezterm.fnl.lua" . source =
9
20
pkgs . runCommand "wezterm.fnl.lua" {
10
21
nativeBuildInputs = [ pkgs . fennel ] ;
17
28
extraConfig = ''
18
29
_G.wezterm = wezterm
19
30
_G.dev_remote = "${ config . userinfo . devRemote } "
31
+ -- fake
32
+ local function getinfo()
33
+ end
34
+ local function traceback()
35
+ end
36
+ _G.debug = {getinfo = getinfo, traceback = traceback}
20
37
local config
21
38
if os.getenv("WEZTERM_FNL") then
22
- -- fake
23
- local function getinfo()
24
- end
25
- _G.debug = {getinfo = getinfo}
26
39
local fennel = dofile("${ pkgs . lua54Packages . fennel } /share/lua/5.4/fennel.lua")
27
40
config = fennel.dofile(os.getenv("WEZTERM_FNL"))
28
41
else
Original file line number Diff line number Diff line change 80
80
(table . insert listing line ))
81
81
listing ))
82
82
83
+ (local default - project - workspace - yaml - path
84
+ (.. wezterm.config_dir :/workspace.yaml))
85
+
86
+ ; (wezterm.log_info "package.loaded.fennel " package.loaded.fennel)
87
+ ; (wezterm.log_info "_G.debug " _G.debug)
88
+
89
+ (fn _G . debug . traceback [] nil )
90
+
91
+ (lambda default - project - workspace []
92
+ (let [(wsloaded err ) (pcall # (with-open [wsyaml (io . open default - project - workspace - yaml - path
93
+ :rb)]
94
+ (wezterm.serde.yaml_decode (wsyaml:read :*a))))]
95
+ (if wsloaded err {:windows [{}]})))
96
+
97
+ (wezterm.log_info "default-project-workspace: " (default - project - workspace ))
98
+
83
99
(lambda project - workspace - config [window pane dir ]
84
- "Reads and returns the workspace config for a project"
100
+ "Reads and returns the effective workspace config for a project"
101
+ (wezterm.log_info "default-project-workspace " (default - project - workspace ))
85
102
(let [(status out err ) (run - child - process window pane
86
103
[:cat (.. dir :/workspace.yaml)])]
87
- (if status (wezterm.serde.yaml_decode out ) { :windows [{}]} )))
104
+ (if status (wezterm.serde.yaml_decode out ) ( default - project - workspace ) )))
88
105
89
106
(lambda project - jump - list [window pane ]
90
107
"Returns a jump list for use with the input selector"
You can’t perform that action at this time.
0 commit comments