From b8e8e1a291eb2af25107c4e5de956132d61636ec Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 26 May 2023 17:01:26 +0000 Subject: fix bugs --- home.nix | 20 +++----------------- home/packages.nix | 1 + shell-scripts/tmux-normal-mode | 11 +++++++++++ 3 files changed, 15 insertions(+), 17 deletions(-) create mode 100644 shell-scripts/tmux-normal-mode diff --git a/home.nix b/home.nix index 0408cfb..80ffc5d 100644 --- a/home.nix +++ b/home.nix @@ -50,7 +50,7 @@ enable = true; extraConfig = '' set-option -g default-shell ${pkgs.bashInteractive}/bin/bash - set -g set-clipboard on + set -s set-clipboard on set -g default-terminal "xterm-256color" set-option -sa terminal-overrides ",xterm-256color:RGB" set-option -g focus-events on @@ -71,22 +71,8 @@ # printf "sel = %s\n" "$line_count" >>/tmp/debug.log ;\ # cursor="''${sel_line}.''${cursor_x},''${sel_line}.''${cursor_x}" ;\ # printf "cursor = %s\n" "$cursor" >>/tmp/debug.log - - bind -n C-s run-shell '\ - kakoune_session="$(tmux display-message -p "#{window_name}" | sed "s/kakc@//")" ;\ - dispatch_name="dispatch://$(tmux display-message -p "#{pane_start_command}")" ;\ - output=$(mktemp -d /tmp/kak-tmux.XXXXXXXX)/fifo ;\ - mkfifo ''${output} ;\ - ( tmux capture-pane -S '-' -E '-' -J -e -p -t $TMUX_PANE | filter-ansi >''${output} & ) ;\ - tmux new-window -t kaks@$kakoune_session -n "$dispatch_name" -d "\ - kak -c $kakoune_session -e \"\ - edit -fifo ''${output} \"''${dispatch_name}\" ;\ - set-option buffer readonly true ;\ - set-option window filetype dispatch ;\ - hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ''${output}) } } ;\ - \" ;\ - " \; - tmux swap-pane -s kaks@$kakoune_session:"$dispatch_name".0 -t :' + + bind -n C-s run-shell tmux-normal-mode ''; }; diff --git a/home/packages.nix b/home/packages.nix index bf7cf28..6c05b22 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -17,6 +17,7 @@ yq-go dasel initool + nnn # shell tools bashInteractive k9s diff --git a/shell-scripts/tmux-normal-mode b/shell-scripts/tmux-normal-mode new file mode 100644 index 0000000..0a956e2 --- /dev/null +++ b/shell-scripts/tmux-normal-mode @@ -0,0 +1,11 @@ +kakoune_session="$(tmux display-message -p "#{window_name}" | sed "s/kakc@//")" +dispatch_name="dispatch://$(tmux display-message -p "#{pane_start_command}")" +output=$(mktemp -d /tmp/kak-tmux.XXXXXXXX)/fifo +mkfifo ${output} +( tmux capture-pane -S '-' -E '-' -J -e -p -t $TMUX_PANE | filter-ansi >${output} & ) +tmux new-window -t kaks@$kakoune_session -n "$dispatch_name" -d " + kak -c '$kakoune_session' -e \"edit -fifo ${output} -scroll '${dispatch_name}';\ + set-option buffer readonly true ;\ + set-option window filetype dispatch ;\ + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } }\"" +tmux swap-pane -s kaks@$kakoune_session:"$dispatch_name".0 -t : -- cgit v1.2.3