From f789ee615faaa36a4543fce5f4cbf5b8a3e13194 Mon Sep 17 00:00:00 2001 From: HerrCraziDev Date: Thu, 13 Apr 2023 17:32:14 +0200 Subject: [PATCH 1/3] tmux scrollback buffer + alias typos --- .aliases | 6 ++++-- tmux/.tmux.conf | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.aliases b/.aliases index b14705b..51b7bae 100644 --- a/.aliases +++ b/.aliases @@ -16,8 +16,8 @@ alias ntopw='speedometer -rx wlp0s20f3 -tx wlp0s20f3' alias ntopeth='speedometer -rx enp7s0 -tx enp7s0' alias svc='sudo systemctl' alias svcup='svc start' -alias scvdown='svc stop' -alias scvrs='svc restart' +alias svcdown='svc stop' +alias svcrs='svc restart' alias py='python3.8' alias pkgi='sudo dpkg -i' alias scr='screen -S dev' @@ -26,4 +26,6 @@ alias tmr='tmux attach' alias ll='ls -lah --color=auto' alias reload='source ~/.termrc' +alias ssj="ssh -J pi@bst1.chenco.dev" + #alias mc-install-plugin='echo "Installing $2"; echo "Done !"' diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 467f7d6..54c6929 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -46,6 +46,9 @@ set -g display-panes-colour colour244 #set-option -g status-utf8 on set -g default-terminal "xterm-256color" +# Scrollback buffer +set -g history-limit 64000 + # Enable mouse integration set -g mouse on From 5a9b7413547c6dde27f12716f8b49890a310df1b Mon Sep 17 00:00:00 2001 From: HerrCraziDev Date: Tue, 2 May 2023 17:49:27 +0200 Subject: [PATCH 2/3] Serial console via USB --- .aliases | 5 +++++ .termrc | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.aliases b/.aliases index 51b7bae..5252c69 100644 --- a/.aliases +++ b/.aliases @@ -29,3 +29,8 @@ alias reload='source ~/.termrc' alias ssj="ssh -J pi@bst1.chenco.dev" #alias mc-install-plugin='echo "Installing $2"; echo "Done !"' + +sm() { + tmux new-window -n serial:$(basename ${@:-1}) sudo picocom --baud 921600 --parity n --databits 8 --stopbits 1 --flow n --escape z $@ +} + diff --git a/.termrc b/.termrc index 4f220d6..bee94cc 100644 --- a/.termrc +++ b/.termrc @@ -29,9 +29,18 @@ if [ -n "$WSLENV" ] ; then # Load SSH keychain /usr/bin/keychain -q --nogui $HOME/.ssh/id_rsa - source $HOME/.keychain/$HOST-sh + source "$HOME/.keychain/$HOST-sh" # Enable entr workaround for incomplete inotify support on WSL export ENTR_INOTIFY_WORKAROUND=1 + + # Connect serial console port if found + if [ -z "$_SERIAL_INIT" ] ; then + source "$HOME/.usbipd" + echo "Connecting serial port... (device $USB_SERIAL_HWID)" + usbipd.exe wsl attach --hardware-id $USB_SERIAL_HWID + usbipd.exe wsl list + export _SERIAL_INIT + fi fi From b14a1524ed23f9991c1474de1329e6d672cbb05c Mon Sep 17 00:00:00 2001 From: HerrCraziDev Date: Wed, 21 Jun 2023 10:34:04 +0200 Subject: [PATCH 3/3] usbipd init, tmux selection clear --- .termrc | 9 +++++++-- tmux/.tmux.conf | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.termrc b/.termrc index bee94cc..989ecae 100644 --- a/.termrc +++ b/.termrc @@ -39,8 +39,13 @@ if [ -n "$WSLENV" ] ; then source "$HOME/.usbipd" echo "Connecting serial port... (device $USB_SERIAL_HWID)" usbipd.exe wsl attach --hardware-id $USB_SERIAL_HWID - usbipd.exe wsl list - export _SERIAL_INIT + if [ $? -eq 0 ]; then + echo "Serial port connected" + usbipd.exe wsl list + export _SERIAL_INIT=1 + else + echo "Unable to connect serial port (device $USB_SERIAL_HWID)" + fi fi fi diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 54c6929..0ed2375 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -26,6 +26,7 @@ bind C-v paste-buffer bind -T copy-mode-vi Enter send -X copy-selection-no-clear \; send -X copy-pipe-and-cancel "xclip -i -sel c" \; display " [tmux] copied!" bind -T copy-mode-vi C-c send -X copy-selection-no-clear \; send -X copy-pipe-and-cancel "xclip -i -sel c" \; display " [tmux] copied!" bind -T copy-mode-vi y send -X copy-selection-no-clear \; send -X copy-pipe "xclip -i -sel c" \; display " [tmux] copied!" +bind -T copy-mode-vi c send -X clear-selection \; display " [tmux] Selection cleared" bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-no-clear bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line