add iterm2 shell integration

This commit is contained in:
Förster
2017-09-19 14:45:34 +02:00
parent d2d7cf0688
commit f06a7abbff
12 changed files with 975 additions and 0 deletions

18
.iterm2/it2dl Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $(basename $0) file ..."
exit 1
fi
for fn in "$@"
do
if [ -r "$fn" ] ; then
[ -d "$fn" ] && { echo "$fn is a directory"; continue; }
printf '\033]1337;File=name='`echo -n "$fn" | base64`";"
wc -c "$fn" | awk '{printf "size=%d",$1}'
printf ":"
base64 < "$fn"
printf '\a'
else
echo File $fn does not exist or is not readable.
fi
done