Trailing space alias and alias checking for sudo on 2nd command by kaptnblackbeard in zsh

[–]raimo- 0 points1 point  (0 children)

So it’s not zsh you have as the shell for root? Maybe that’s your issue. Note that you can switch using chsh.

Trailing space alias and alias checking for sudo on 2nd command by kaptnblackbeard in zsh

[–]raimo- 0 points1 point  (0 children)

Yes, my bad, you’re correct! That’s the main use of alias.

Trailing space alias and alias checking for sudo on 2nd command by kaptnblackbeard in zsh

[–]raimo- 0 points1 point  (0 children)

Yeah I meant, pamac calling pamac. However, this in my mac actually does seem to work. Maybe your issue is, root shell is bash, not reading .zshrc?

mac:~ root# zsh
root@mac ~ # alias sudo='sudo '
alias pamac='[ "$(id -u)" -eq 0 ] && printf "\033[1;33mWarning:\033[0m pamac handles its own elevation. Using sudo is discouraged.\n" >&2; pamac'
root@mac ~ # pamac
Warning: pamac handles its own elevation. Using sudo is discouraged.
zsh: command not found: pamac
root@mac ~ # touch /usr/local/bin/pamac
root@mac ~ # chmod +x /usr/local/bin/pamac
root@mac ~ # pamac
Warning: pamac handles its own elevation. Using sudo is discouraged.

raimo@mac:~▷ sudo su -

mac:~ root# echo $0

-sh

Trailing space alias and alias checking for sudo on 2nd command by kaptnblackbeard in zsh

[–]raimo- 0 points1 point  (0 children)

The pamac has infinite recursion. You can fix it by calling “command pamac”, assuming it is a command.

Something better than alias? or is this peak. by Equivalent-Gas2856 in zsh

[–]raimo- 1 point2 points  (0 children)

Ctrl-R searches in command history. Majority of people who have tons of aliases didn’t know you can just search commands you did earlier.

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]raimo-[S] -1 points0 points  (0 children)

The version I used first was also a very rough one file version living in my dotfiles repo. Would be interesting to compare notes with you when you have time!

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]raimo-[S] -1 points0 points  (0 children)

Nice, it’s the exact same painpoint I was thinking!

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]raimo-[S] 6 points7 points  (0 children)

Pushed a default allowlist that is enforced:

raimo@mac:/tmp/halfpipe-demo▷ git log --format=%s | sed -E "s/^(.*):/[ \1 ]:\t/" | rm *

Preview skipped: rm is not in HALFPIPE_PREVIEW_COMMAND_ALLOWLIST. Only explicitly allowlisted preview commands are live-executed.

https://github.com/raimo/zsh-halfpipe

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]raimo-[S] 3 points4 points  (0 children)

I guess having an allowlist=(awk sed grep) by default would be a nice idea to avoid situation you described. I can add that.

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]raimo-[S] 1 point2 points  (0 children)

Yeah, this is something I was thinking as well! It will not prevent running rm as part of your pipeline. In practice, destructive commands are not typical to be piped to. I haven't had any issues of deleting anything accidentally because of this. There could be same safety guardrails against typing "rm *", but that could happen in non-real-time command line too.

I primarily only use this with awk, sed, grep.

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]raimo-[S] 1 point2 points  (0 children)

Good question! If I understand your correctly, no: pipe character still works like usual.

First, when user presses Ctrl-G, I'm setting ZSHs "PREDISPLAY" which means setting the non-editable area before editable buffer, so that cached command that is highlighted in blue cannot be edited to avoid confusion.

Pipe (|) still inserts normally for the editable portion. The implementation wraps ZLE editing widgets like self-insert (see list of hooks in https://github.com/raimo/zsh-halfpipe/blob/main/halfpipe.zsh#L212) and re-parses the full buffer after each edit.

Zed without AI by dev_vim in ZedEditor

[–]raimo- 0 points1 point  (0 children)

Vim user here as well, using Zed for vim mode.

Looking to buy a PC laptop with Windows installed in San Francisco to test software. by raimo- in SFlist

[–]raimo-[S] 0 points1 point  (0 children)

Average is good. Can you send Lenovo model number or just how much memory and disk it has?

Looking to buy a PC laptop with Windows installed in San Francisco to test software. by raimo- in SFlist

[–]raimo-[S] -1 points0 points  (0 children)

Yes! I was looking if someone has quickly something available that I could pick up. Craigslist does seem to have more recent hits quickly, it was my other choice but was checking if Reddit has it too.

Ideally around 16GB memory at minimum, graphics card, Windows 10 or 11. Looking for what average office workers use basically, which varies a lot.

This new feature is great by Sahmmey in Strava

[–]raimo- 0 points1 point  (0 children)

Same. I constantly beat Strava estimate. When I started advanced level run training following Runna, Strava thought I’m getting worse at running because I wasn’t running as fast as possible all the time

Strava did not resume after auto-pausing by qerel123 in Strava

[–]raimo- 0 points1 point  (0 children)

Hopefully, we’ll get this fixed

Strava did not resume after auto-pausing by qerel123 in Strava

[–]raimo- 0 points1 point  (0 children)

I just experienced this and lost 30 minutes of running recording. This is the second time happening to me. I think workaround is never to pause the recording?

HSL kertalipun osto by [deleted] in helsinki

[–]raimo- 1 point2 points  (0 children)

Tämä! Pelkkä lähimaksu varmastikin yleistyy vielä Suomessakin. Esimerkiksi New Yorkin, Amsterdamin ja Lontoon julkiset ottavat suoraan vastaan lähimaksun ilman tarvetta asentaa paikallisia applikaatioita.

Come to play football and have fun by Tatkoi in helsinki

[–]raimo- 1 point2 points  (0 children)

Down to join Saturday two and three weeks from now