@jx0/jmux 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/defaults.conf +6 -0
- package/config/move-window.sh +32 -0
- package/config/rename-session.sh +26 -0
- package/package.json +1 -1
- package/src/main.ts +2 -1
- package/src/tmux-control.ts +6 -0
package/config/defaults.conf
CHANGED
|
@@ -59,6 +59,12 @@ set -g window-active-style 'fg=#b5bcc9'
|
|
|
59
59
|
bind k send-keys -R \; clear-history \; display-message "Pane cleared"
|
|
60
60
|
bind y run-shell "tmux capture-pane -pS - -E - | grep . | pbcopy" \; display-message "Copied pane to clipboard"
|
|
61
61
|
|
|
62
|
+
# Move window to another session (C-a m)
|
|
63
|
+
bind-key m display-popup -E -w 40% -h 50% -b heavy -S 'fg=#4f565d' "$JMUX_DIR/config/move-window.sh"
|
|
64
|
+
|
|
65
|
+
# Rename session (C-a r)
|
|
66
|
+
bind-key r display-popup -E -w 40% -h 8 -b heavy -S 'fg=#4f565d' "$JMUX_DIR/config/rename-session.sh"
|
|
67
|
+
|
|
62
68
|
# Window switcher popup (C-a j) — jmux overrides this for sidebar mode,
|
|
63
69
|
# but it's still available if sidebar mode changes
|
|
64
70
|
bind-key j display-popup -E -x 0 -y 0 -w 30% -h 100% -b heavy -S 'fg=#4f565d' \
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# jmux move window — pick a destination session
|
|
3
|
+
# Called via: display-popup -E "move-window.sh"
|
|
4
|
+
|
|
5
|
+
FZF_COLORS="border:#4f565d,header:#b5bcc9,prompt:#9fe8c3,label:#9fe8c3,pointer:#9fe8c3,fg:#6b7280,fg+:#b5bcc9,hl:#fbd4b8,hl+:#fbd4b8"
|
|
6
|
+
|
|
7
|
+
CURRENT_WINDOW=$(tmux display-message -p '#W')
|
|
8
|
+
CURRENT_SESSION=$(tmux display-message -p '#S')
|
|
9
|
+
|
|
10
|
+
# List all sessions except the current one
|
|
11
|
+
SESSIONS=$(tmux list-sessions -F '#S' | grep -v "^${CURRENT_SESSION}$")
|
|
12
|
+
|
|
13
|
+
if [ -z "$SESSIONS" ]; then
|
|
14
|
+
echo "No other sessions to move to."
|
|
15
|
+
sleep 1
|
|
16
|
+
exit 0
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
TARGET=$(echo "$SESSIONS" | fzf \
|
|
20
|
+
--height=100% \
|
|
21
|
+
--layout=reverse \
|
|
22
|
+
--border=rounded \
|
|
23
|
+
--border-label=" Move Window " \
|
|
24
|
+
--header="Moving: $CURRENT_WINDOW → ?" \
|
|
25
|
+
--header-first \
|
|
26
|
+
--prompt="Session: " \
|
|
27
|
+
--pointer="▸" \
|
|
28
|
+
--color="$FZF_COLORS")
|
|
29
|
+
|
|
30
|
+
[ -z "$TARGET" ] && exit 0
|
|
31
|
+
|
|
32
|
+
tmux move-window -t "$TARGET:"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# jmux rename session
|
|
3
|
+
# Called via: display-popup -E "rename-session.sh"
|
|
4
|
+
|
|
5
|
+
FZF_COLORS="border:#4f565d,header:#b5bcc9,prompt:#9fe8c3,label:#9fe8c3,pointer:#9fe8c3,fg:#6b7280,fg+:#b5bcc9,hl:#fbd4b8,hl+:#fbd4b8"
|
|
6
|
+
|
|
7
|
+
CURRENT_NAME=$(tmux display-message -p '#S')
|
|
8
|
+
|
|
9
|
+
NEW_NAME=$(echo "" | fzf --print-query \
|
|
10
|
+
--height=100% \
|
|
11
|
+
--layout=reverse \
|
|
12
|
+
--border=rounded \
|
|
13
|
+
--border-label=" Rename Session " \
|
|
14
|
+
--header="Current: $CURRENT_NAME" \
|
|
15
|
+
--header-first \
|
|
16
|
+
--prompt="Name: " \
|
|
17
|
+
--query="$CURRENT_NAME" \
|
|
18
|
+
--pointer="" \
|
|
19
|
+
--no-info \
|
|
20
|
+
--color="$FZF_COLORS" \
|
|
21
|
+
| head -1)
|
|
22
|
+
|
|
23
|
+
[ -z "$NEW_NAME" ] && exit 0
|
|
24
|
+
[ "$NEW_NAME" = "$CURRENT_NAME" ] && exit 0
|
|
25
|
+
|
|
26
|
+
tmux rename-session "$NEW_NAME"
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { homedir } from "os";
|
|
|
12
12
|
|
|
13
13
|
// --- CLI commands (run and exit before TUI) ---
|
|
14
14
|
|
|
15
|
-
const VERSION = "0.3.
|
|
15
|
+
const VERSION = "0.3.1";
|
|
16
16
|
|
|
17
17
|
const HELP = `jmux — a persistent session sidebar for tmux
|
|
18
18
|
|
|
@@ -339,6 +339,7 @@ process.on("SIGWINCH", () => {
|
|
|
339
339
|
control.onEvent((event: ControlEvent) => {
|
|
340
340
|
switch (event.type) {
|
|
341
341
|
case "sessions-changed":
|
|
342
|
+
case "session-renamed":
|
|
342
343
|
fetchSessions();
|
|
343
344
|
break;
|
|
344
345
|
case "session-changed":
|
package/src/tmux-control.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { Subprocess } from "bun";
|
|
|
5
5
|
export type ControlEvent =
|
|
6
6
|
| { type: "sessions-changed" }
|
|
7
7
|
| { type: "session-changed"; args: string }
|
|
8
|
+
| { type: "session-renamed"; args: string }
|
|
8
9
|
| { type: "window-renamed"; args: string }
|
|
9
10
|
| { type: "client-session-changed"; args: string }
|
|
10
11
|
| {
|
|
@@ -83,6 +84,11 @@ export class ControlParser {
|
|
|
83
84
|
type: "session-changed",
|
|
84
85
|
args: line.slice("%session-changed ".length),
|
|
85
86
|
});
|
|
87
|
+
} else if (line.startsWith("%session-renamed ")) {
|
|
88
|
+
this.emit({
|
|
89
|
+
type: "session-renamed",
|
|
90
|
+
args: line.slice("%session-renamed ".length),
|
|
91
|
+
});
|
|
86
92
|
} else if (line.startsWith("%window-renamed ")) {
|
|
87
93
|
this.emit({
|
|
88
94
|
type: "window-renamed",
|