@abyrd9/harbor-cli 2.0.0 → 2.0.2

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/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyrd9/harbor-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A CLI tool for orchestrating local development services in tmux sessions. Perfect for microservices and polyglot projects with automatic service discovery and before/after script support.",
5
5
  "type": "module",
6
6
  "bin": {
package/scripts/dev.sh CHANGED
@@ -21,7 +21,8 @@ start_log_trim() {
21
21
  local log_file="$1"
22
22
  local max_lines="$2"
23
23
  # Run trimmer inside tmux so it survives script exit
24
- tmux send-keys -t "$session_name":0 "( while true; do sleep 5; if [ -f \"$log_file\" ]; then lines=\$(wc -l < \"$log_file\"); if [ \"\$lines\" -gt $max_lines ]; then tail -n $max_lines \"$log_file\" > \"${log_file}.tmp\" && mv \"${log_file}.tmp\" \"$log_file\"; fi; fi; done ) &" C-m
24
+ # Use cp + truncate + cat to preserve the file descriptor (pipe-pane keeps writing to same fd)
25
+ tmux send-keys -t "$session_name":0 "( while true; do sleep 5; if [ -f \"$log_file\" ]; then lines=\$(wc -l < \"$log_file\"); if [ \"\$lines\" -gt $max_lines ]; then tail -n $max_lines \"$log_file\" > \"${log_file}.tmp\" && cat \"${log_file}.tmp\" > \"$log_file\" && rm \"${log_file}.tmp\"; fi; fi; done ) &" C-m
25
26
  }
26
27
 
27
28
  trap cleanup_logs EXIT
@@ -124,9 +125,10 @@ while read service; do
124
125
  if [ "$log" = "true" ]; then
125
126
  log_file="$repo_root/.harbor/${session_name}-${name}.log"
126
127
  : > "$log_file"
127
- # Run command directly (not via send-keys) to avoid shell echo
128
- # Strip ANSI escape sequences and control chars before writing to log file
129
- tmux new-window -t "$session_name":$window_index -n "$name" "cd \"$path\" && $command 2>&1 | sed -u 's/\\x1b\\[[0-9;]*[mGKHJ]//g' | tee -a \"$log_file\"; exec bash"
128
+ # Use pipe-pane to capture ALL terminal output (works with any program, no buffering issues)
129
+ tmux new-window -t "$session_name":$window_index -n "$name"
130
+ tmux pipe-pane -t "$session_name":$window_index "cat >> \"$log_file\""
131
+ tmux send-keys -t "$session_name":$window_index "cd \"$path\" && $command" C-m
130
132
  # Start background process to trim logs if they get too large
131
133
  start_log_trim "$log_file" "$effective_max_lines"
132
134
  else