view bin/executable_clip @ 802:9c8698e50c5e

[pre-commit.ci] pre-commit autoupdate updates: - [github.com/JohnnyMorganz/StyLua: v0.19.0 ? v0.19.1](https://github.com/JohnnyMorganz/StyLua/compare/v0.19.0...v0.19.1)
author pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
date Mon, 20 Nov 2023 18:04:55 +0000
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