view bin/executable_clip @ 564:b251d808fa04

Add tmux mapping to select the last command output and open selection in quickfix
author zegervdv <zegervdv@me.com>
date Sat, 19 Feb 2022 16:38:21 +0100
parents eba1dee43703
children
line wrap: on
line source

#!/usr/bin/env bash

DATA=$(cat - | sed -r "s/\x1b\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | base64)

if [ -z "$TMUX" ]; then
  echo -ne "\e]52;c;${DATA}\x07"
else
  echo -ne "\ePtmux;\e\e]52;c;${DATA}\x07\e\\"
fi