1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-11 15:23:41 +08:00

Compare commits

...

6 Commits

Author SHA1 Message Date
zwyyy456
345ca47088
Merge 3ce427d196 into 92aed2e936 2025-12-11 11:01:14 +08:00
Tanzim Hossain Romel
92aed2e936
feat(extract): add unar as fallback for RAR extraction (#13472)
Add unar as a fallback when unrar is not available for extracting
RAR files. This addresses the issue where unrar has been removed
from Homebrew due to licensing issues.

The extraction now:
- Prefers unrar if available (backward compatible)
- Falls back to unar if unrar is not found
- Shows helpful error message if neither tool is installed
2025-12-09 20:14:31 +01:00
zwy
3ce427d196 feat(clipboard, copybuffer): fix typo, add 'yy' to yank buffer in vi-normal mode 2024-12-29 22:10:23 +09:00
zwy
7bdca23779 Merge remote-tracking branch 'zwyyy/master' 2024-12-29 22:08:15 +09:00
zwyyy456
32b4d285c3 fix(typo): make the name of local varialbe more readable 2024-12-29 17:07:13 +08:00
zwyyy456
44f7c5798e feat(clipboard): add simple osc52 support 2024-12-29 16:47:56 +08:00
3 changed files with 21 additions and 1 deletions

View File

@ -84,6 +84,17 @@ function detect-clipboard() {
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clippaste() { tmux save-buffer -; }
elif [[ "$TERM" == "xterm"* || "$TERM" == "screen"* || "$TERM" == "tmux"* ]]; then
# OSC 52 support
function clipcopy() {
local content_tocopy
content_tocopy=$(cat "${1:-/dev/stdin}" | base64 | tr -d '\n')
printf "\033]52;c;%s\a" "$content_tocopy" > /dev/tty
}
function clippaste() {
echo "OSC 52 does not support pasting from the clipboard."
return 1
}
else
function _retry_clipboard_detection_or_fail() {
local clipcmd="${1}"; shift

View File

@ -14,3 +14,4 @@ zle -N copybuffer
bindkey -M emacs "^O" copybuffer
bindkey -M viins "^O" copybuffer
bindkey -M vicmd "^O" copybuffer
bindkey -M vicmd "yy" copybuffer

View File

@ -77,7 +77,15 @@ EOF
(*.lzma) unlzma "$full_path" ;;
(*.z) uncompress "$full_path" ;;
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx|*.pk3|*.pk4) unzip "$full_path" ;;
(*.rar) unrar x -ad "$full_path" ;;
(*.rar)
if (( $+commands[unrar] )); then
unrar x -ad "$full_path"
elif (( $+commands[unar] )); then
unar -o . "$full_path"
else
echo "extract: cannot extract RAR files: install unrar or unar" >&2
success=1
fi ;;
(*.rpm)
rpm2cpio "$full_path" | cpio --quiet -id ;;
(*.7z | *.7z.[0-9]* | *.pk7) 7za x "$full_path" ;;