Tired of spamming Yubikey OTP codes into Slack? Here are two options to help prevent that. You can do either or both. Both require ykman, the Yubikey CLI configuration manager. Get it with Homebrew:
brew install ykman
By default, Yubikeys send the <Enter> character after sending the modhex code. You may disable this behavior. First, confirm which slot you have programmed:
$ ykman otp info
YubiKey 4
Slot 1: programmed
Slot 2: emptyIn this case, slot 1 is programmed. Configure the programmed slot not to send enter:
$ ykman otp settings --no-enter 1Yubikeys have two OTP slots. The device uses the duration of the touch to determine which slot to use to emit a code: slot 1 requires about a half-second touch, and slot 2 requires about a two-second touch. By default, OTP is written to slot 1, meaning it's easy to trigger accidentally. You may swap the configurations in the slots, which usually means moving the configuration progammed in slot 1 to slot 2, leaving slot 1 empty:
$ ykman otp swapThis is usually suitable when you use the OTP function of your Yubikey only rarely — if you use it often, the longer delay may be irritating.
https://support.yubico.com/support/solutions/articles/15000006461-swapping-yubico-otp-from-slot-1-to-slot-2 https://github.com/Yubico/yubikey-manager
Also https://github.com/pallotron/yubiswitch