summary refs log tree commit diff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/osc714
1 files changed, 14 insertions, 0 deletions
diff --git a/.local/bin/osc7 b/.local/bin/osc7
new file mode 100755
index 0000000..bdd034a
--- /dev/null
+++ b/.local/bin/osc7
@@ -0,0 +1,14 @@
+#!/bin/sh
+	tmp="$PWD"
+	enc=""
+	while [ -n "$tmp" ]; do
+		cut="${tmp#?}"
+		c="${tmp%"$cut"}"
+		case "$c" in
+			[-/:_.!\'\(\)~[:alnum:]] ) enc="$enc$c" ;;
+			* ) enc="$enc$(printf '%%%02X' """\"$c")"  ;;
+		esac
+		tmp="$cut"
+	done
+
+	printf "\033]7;file://%s%s\007" "$(hostname)" "$enc"