diff --git a/lib/fingers/action_runner.rb b/lib/fingers/action_runner.rb index c58a518..c0eec4d 100644 --- a/lib/fingers/action_runner.rb +++ b/lib/fingers/action_runner.rb @@ -11,7 +11,8 @@ class Fingers::ActionRunner return unless final_shell_command - `tmux run-shell -b "#{final_shell_command} &> #{Fingers::Dirs::LOG_PATH}"` + redirect_to_log_file = ">>#{Fingers::Dirs::LOG_PATH} 2>&1" + `tmux run-shell -b "#{final_shell_command} #{redirect_to_log_file}"` end private diff --git a/lib/fingers/commands/load_config.rb b/lib/fingers/commands/load_config.rb index abd9712..b77e056 100644 --- a/lib/fingers/commands/load_config.rb +++ b/lib/fingers/commands/load_config.rb @@ -80,11 +80,10 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base end def setup_bindings - # ruby input_mode = 'fingers-mode' ruby_bin = "#{RbConfig.ruby} --disable-gems" - `tmux bind-key #{Fingers.config.key} run-shell -b "#{ruby_bin} #{cli} start '#{input_mode}' '\#{pane_id}' >#{Fingers::Dirs::LOG_PATH} 2>&1"` + `tmux bind-key #{Fingers.config.key} run-shell -b "#{ruby_bin} #{cli} start '#{input_mode}' '\#{pane_id}' >>#{Fingers::Dirs::LOG_PATH} 2>&1"` setup_fingers_mode_bindings if input_mode == 'fingers-mode' end diff --git a/lib/fingers/commands/start.rb b/lib/fingers/commands/start.rb index 8eda6fd..b7f373d 100644 --- a/lib/fingers/commands/start.rb +++ b/lib/fingers/commands/start.rb @@ -113,6 +113,7 @@ class Fingers::Commands::Start < Fingers::Commands::Base tmux.disable_prefix tmux.set_key_table 'fingers' + Fingers.benchmark_stamp('ready-for-input:end') Fingers.trace_for_tests_do_not_remove_or_the_whole_fabric_of_reality_will_tear_apart_with_unforeseen_consequences('fingers-ready') input_socket.on_input do |input| diff --git a/lib/fingers/config.rb b/lib/fingers/config.rb index a6c7af3..1907a56 100644 --- a/lib/fingers/config.rb +++ b/lib/fingers/config.rb @@ -56,9 +56,9 @@ module Fingers end def self.load_from_cache - Fingers.benchmark_stamp('load_config_from_cache:start') + Fingers.benchmark_stamp('load-config-from-cache:start') result = Marshal.load(File.open(CONFIG_PATH)) - Fingers.benchmark_stamp('load_config_from_cache:end') + Fingers.benchmark_stamp('load-config-from-cache:end') result end end diff --git a/spec/acceptance/performance_spec.rb b/spec/acceptance/performance_spec.rb index f40960d..4e7fd6d 100644 --- a/spec/acceptance/performance_spec.rb +++ b/spec/acceptance/performance_spec.rb @@ -20,11 +20,6 @@ def measure_benchmarks elsif phase == 'end' _, start_ms = step_stack.pop - puts "step: #{step}" - puts "ms: #{ms}" - puts "start_ms: #{start_ms}" - puts '----' - ellapsed_ms = ms - start_ms ellapsed_times_by_step[step] = [] unless ellapsed_times_by_step[step] diff --git a/spec/tmuxomatic_setup.rb b/spec/tmuxomatic_setup.rb index e612cea..666be4b 100644 --- a/spec/tmuxomatic_setup.rb +++ b/spec/tmuxomatic_setup.rb @@ -30,7 +30,7 @@ shared_context 'tmuxomatic setup', a: :b do tmuxomatic.send_keys(tmuxomatic_pane_id, keys) if trace_benchmark Fingers.benchmark_stamp('boot:start') - Fingers.benchmark_stamp('ready_for_input:start') + Fingers.benchmark_stamp('ready-for-input:start') end end # TODO: detect when key is received, is it even possible? diff --git a/tmux-fingers.tmux b/tmux-fingers.tmux index 23136ca..ab69fa0 100755 --- a/tmux-fingers.tmux +++ b/tmux-fingers.tmux @@ -1,7 +1,8 @@ #!/usr/bin/env ruby fingers_root = File.dirname(__FILE__) -redirect_to_log_file = ">#{fingers_root}/fingers.log 2>&1" -`tmux run-shell -b "#{fingers_root}/bin/fingers load_config #{redirect_to_log_file}"` +redirect_to_log_file = ">>#{fingers_root}/fingers.log 2>&1" + +`tmux run-shell -b "#{fingers_root}/bin/fingers load_config"` `tmux run-shell -b "#{fingers_root}/bin/fingers check_version #{redirect_to_log_file}"`