view bin/executable_clip @ 799:e751d67116ed

[pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-prettier: v3.0.1 ? v3.0.2](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.1...v3.0.2)
author pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
date Mon, 21 Aug 2023 22:37:11 +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