Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/kutsan/zsh-system-clipboard
Zsh plugin that adds key bindings support for ZLE (Zsh Line Editor) clipboard operations for vi emulation keymaps. It works under Linux, macOS and Android (via Termux).
By default, ZLE has its own clipboard buffer. So, using keys like y inside ZLE's normal mode for yanking operations will not send that yanked text to system clipboard. It will live inside ZLE and using C-v won't paste that text in another program. This plugin synchronizes your system clipboard with ZLE buffers while it's not overriding anything. You can still use ZLE's " register if you want to.
It also synchronizes tmux clipboard buffers if tmux available and the ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT
variable is set to 'true'
. See Options section for more details.
Use your favorite plugin manager, e.g. zplug:
zplug "kutsan/zsh-system-clipboard"
Clone this repository somewhere,
git clone https://github.com/kutsan/zsh-system-clipboard ~/.zsh/plugins/zsh-system-clipboard
Source the zsh-system-clipboard.zsh
file in your ~/.zshrc
.
source "$HOME/.zsh/plugins/zsh-system-clipboard/zsh-system-clipboard.zsh"
The script zsh-system-clipboard.zsh
parses the output of bindkey -M vicmd
, bindkey -M emacs
, bindkey -M visual
in order to rebind your keys (along with the default ones) the ZLE widgets
functions that copy from and paste to the system clipboard. This means that you should put all of your bindings before sourcing zsh-system-clipboard.zsh
in your ~/.zshrc
.
Note: widget functions that replace builtin functions for the emacs
keymap are not yet written (see #12).
ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT
: Set it to 'true'
to enable tmux support. That way, if tmux available, every new clipboard content will be also sent to tmux clipboard buffers. Run tmux choose-buffer
to view them.ZSH_SYSTEM_CLIPBOARD_XCLIP_SELECTION
: Specify which X selection to use for xclip
utility. Either 'PRIMARY'
or 'CLIPBOARD'
. Defaults to 'CLIPBOARD'
.For example:
typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'
typeset -g ZSH_SYSTEM_CLIPBOARD_XCLIP_SELECTION='PRIMARY'
The plugin itself provides a separate cross-platform clipboard API for internal widgets. You can use this API as a standalone function.
To set system clipboard buffer:
_zsh_system_clipboard_set "example text"
To get system clipboard buffer to stdout
:
_zsh_system_clipboard_get
It will show pretty-printed errors via stderr
or stdout
if something went wrong.
Special thanks to Doron Behar (@doronbehar) for their interests, suggestions, time and pull requests.
GPL-3.0
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.