serhii.net

In the middle of the desert you can say anything you want

14 May 2021

Day 864

zsh bracketed paste (don’t run command in terminal when pasting)

Stop terminal auto executing when pasting a command - Ask Ubuntu:

  • If you copy a newline symbol at the end of whatever you are copying, it gets executed as expected
  • bracketed paste (enabled by default on zsh) disables this behaviour

Had unset zle_bracketed_paste in zsh config, likely needed for athame that I don’t use. Removed it, works now.

To enable in bash,

echo "set enable-bracketed-paste" >> .inputrc

I should make an eventual list of dotfiles I use for all remote servers, this will go there 100%.

Docker COPY copies contents, not directory

Docker COPY copies contents, not directory \
Docker COPY copies contents, not directory \
Docker COPY copies contents, not directory \
Docker COPY copies contents, not directory \

kitty hint for IPs + python non-capturing (unnamed?) groups

Added these to kitty config! One for IPs, second IPs+ports:

map kitty_mod+n>i kitten hints --type regex --regex [0-9]+(?:\.[0-9]+){3} --program @
map kitty_mod+n>p kitten hints --type regex --regex [0-9]+(?:\.[0-9]+){3}:[0-9]+ --program @

Glad I can still read and understand regexes. The above highlight more than needed, but seems to be kitty’s problem.

In python, a group without ?: is a non-capturing group in python (= not returned in .groups()). In kitty (that uses python syntax), only what’s inside the first capturing group is copied; making it non-capturing makes it copy the entire regex. 1

I added another kitty hint to copy CLI commands currently being typed:

# CLI Commands
map kitty_mod+n>c kitten hints --type regex --regex "\$(.+)\s*$" --program @

My regex is trivial, the capturing group gets the command without the leading $ and avoids all trailing whitespaces.

Docker run detached mode

The magic -dp 8000:8000 command I’ve been using is actually -d -p, with -p being what I want and -d turning on detached mode. Without it, I see the logs directly and can easily <Ctrl-c> it away.

Also, docker ps shows ports as part of the output.

Setting timezone

Let this be the final one, with all configs correct now:

timedatectl set-timezone Europe/XXX

Quotes

In the Buddhist interpretation of it, “BE WHERE YOU ARE”.


  1. Hints — kitty 0.20.3 documentation ↩︎

Nel mezzo del deserto posso dire tutto quello che voglio.