File tree Expand file tree Collapse file tree 6 files changed +23
-45
lines changed Expand file tree Collapse file tree 6 files changed +23
-45
lines changed Original file line number Diff line number Diff line change @@ -6,26 +6,11 @@ source "$CURRENT_DIR/scripts/variables.sh"
66source " $CURRENT_DIR /scripts/shared.sh"
77
88
9- setup_logging_key_binding () {
9+ main () {
1010 tmux bind-key " $logging_key " run-shell " $CURRENT_DIR /scripts/toggle_logging.sh"
11- }
12-
13- setup_screen_capture_key_binding () {
1411 tmux bind-key " $pane_screen_capture_key " run-shell " $CURRENT_DIR /scripts/screen_capture.sh"
15- }
16-
17- setup_save_complete_history_key_binding () {
1812 tmux bind-key " $save_complete_history_key " run-shell " $CURRENT_DIR /scripts/save_complete_history.sh"
19- }
20-
21- setup_clear_history_key_binding () {
2213 tmux bind-key " $clear_history_key " run-shell " $CURRENT_DIR /scripts/clear_history.sh"
2314}
2415
25- main () {
26- setup_logging_key_binding
27- setup_screen_capture_key_binding
28- setup_save_complete_history_key_binding
29- setup_clear_history_key_binding
30- }
3116main
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,11 +4,14 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44
55source " $CURRENT_DIR /variables.sh"
66source " $CURRENT_DIR /shared.sh"
7- source " $CURRENT_DIR /capture_pane_helpers.sh"
87
98main () {
109 if supported_tmux_version_ok; then
11- capture_pane " History"
10+ local file=$( expand_tmux_format_path " ${save_complete_history_full_filename} " )
11+ local history_limit=" $( tmux display-message -p -F " #{history_limit}" ) "
12+ tmux capture-pane -J -S " -${history_limit} " -p > " ${file} "
13+ remove_empty_lines_from_end_of_file " ${file} "
14+ display_message " History saved to ${file} "
1215 fi
1316}
1417main
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44
55source " $CURRENT_DIR /variables.sh"
66source " $CURRENT_DIR /shared.sh"
7- source " $CURRENT_DIR /capture_pane_helpers.sh"
87
98main () {
109 if supported_tmux_version_ok; then
11- capture_pane " Screen capture"
10+ local file=$( expand_tmux_format_path " ${screen_capture_full_filename} " )
11+ tmux capture-pane -J -p > " ${file} "
12+ remove_empty_lines_from_end_of_file " ${file} "
13+ display_message " Screen capture saved to ${file} "
1214 fi
1315}
1416main
Original file line number Diff line number Diff line change @@ -43,3 +43,13 @@ remove_empty_lines_from_end_of_file() {
4343supported_tmux_version_ok () {
4444 $CURRENT_DIR /check_tmux_version.sh " $SUPPORTED_VERSION "
4545}
46+
47+ # Checking full path to logfile and expanding tmux format in normal path
48+ # As example: expand %Y-%m-%d to current date
49+ expand_tmux_format_path () {
50+ local tmux_format_path=$1
51+ local full_path=$( tmux display-message -p " ${tmux_format_path} " )
52+ local full_directory_path=${full_path%/* }
53+ mkdir -p " ${full_directory_path} "
54+ echo " ${full_path} "
55+ }
Original file line number Diff line number Diff line change @@ -7,11 +7,9 @@ source "$CURRENT_DIR/shared.sh"
77
88
99start_pipe_pane () {
10- local file=$( tmux display-message -p " $logging_full_filename " )
11- local path=$( tmux display-message -p " $logging_path " )
12- mkdir -p " $path "
13- " $CURRENT_DIR /start_logging.sh" " $file "
14- display_message " Started logging to $logging_full_filename "
10+ local file=$( expand_tmux_format_path " ${logging_full_filename} " )
11+ " $CURRENT_DIR /start_logging.sh" " ${file} "
12+ display_message " Started logging to ${logging_full_filename} "
1513}
1614
1715stop_pipe_pane () {
You can’t perform that action at this time.
0 commit comments