Skip to content

Commit 372b306

Browse files
committed
chore(cli): added debug mode via BETTER_TMUX_DEBUG env
1 parent e3b61c7 commit 372b306

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

examples/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default {
3434
],
3535
options:{
3636
setTitlesString: " ",
37-
prefix: 'C-c'
37+
prefix: 'C-a'
3838
},
3939
status: {
4040
left: <StatusLeft />,

packages/cli/src/core/Debug.res

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
let log = (content) => {
2+
let debugMode = Bun.Env.get(Bun.env, "BETTER_TMUX_DEBUG")
3+
switch debugMode {
4+
| Some("1") => Console.log2("[🔎 BetterTmux] Executing Command: ", content)
5+
| Some(_)
6+
| None => ()
7+
}
8+
}

packages/cli/src/core/Tmux.res

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ let parse = command =>
5656
| Bind(key, command, options) => `tmux bind ${key} ${command} ${options->Array.join(" ")}`
5757
}
5858

59-
let exec = command => command->parse->ChildProcess.execSync->ignore
59+
let exec = command => {
60+
let parsedCommand = command->parse
61+
Debug.log(parsedCommand)
62+
parsedCommand->ChildProcess.execSync->ignore
63+
}

0 commit comments

Comments
 (0)