Hacker News new | past | comments | ask | show | jobs | submit | sidneythekidney's comments login

My curl complains when -J/--remote-header-name and -C/--continue-at is combined.

  $ curl -JLOC- "https://news.ycombinator.com/news.css?nZdOgS3Y18zj0ynCo50h"
  curl: --continue-at and --remote-header-name cannot be combined
  curl: try 'curl --help' or 'curl --manual' for more information


If you only need to clear the screen, you may want to check out clear(1).


I literally edited my comment just before you said this because I suddenly realized someone was going to say this. No, the point is never just the "screen". The point is the whole buffer including the screen. Clearing just the screen is pretty useless to me, I might as well just scroll down or hold Enter for 3 seconds.


My terminal emulator of choice, WezTerm, has this feature built in [1], so there's no need for using `reset`. Perhaps your terminal emulator has something like it, too?

[1] https://wezfurlong.org/wezterm/config/lua/keyassignment/Clea...


Why in the world would I do that when I can just redefine reset and have it work from every terminal?!


Hah :)

You could try echo -ne '\ec' or echo -ne '\033c'. Or this from bash/readline:

  clear-display (M-C-l)
          Clear  the  screen  and,  if possible, the terminal's scrollback buffer, then redraw the current line, leaving the current line at the top of the screen.
But yea, this might depend on terminal as well


I'm aware, I already have

  reset() { clear && printf '\33c'; }


> Clearing just the screen is pretty useless to me, I might as well just scroll down or hold Enter for 3 seconds.

I actually do that a lot, when I'm done with a terminal window for now but want the scrollback to stay there. ctrl-L to send a pagebreak is what I usually do, or typing something aliased to `clear`.


I set $PATH in ~/.zshenv. If you don't, you can't use any of your "extra stuff" in your zsh-scripts, as they do not use login or interactive sessions. And then I unset GLOBAL_RCS so the system configfiles don't override my settings.

In your guide, under ~/.zshenv, you mention that "macOS overrides this for PATH settings for interactive shells", without mentioning why or how. What's happening is that macOS sets your path in /etc/zprofile.

It seems your guide is missing a few global configfiles :) This is the order for an interactive login shell [1]:

  /etc/zshenv
  ${ZDOTDIR:-$HOME}/.zshenv
  /etc/zprofile                 (login)
  ${ZDOTDIR:-$HOME}/.zprofile   (login)
  /etc/zshrc                    (interactive)
  ${ZDOTDIR:-$HOME}/.zshrc      (interactive)
  /etc/zlogin                   (login)
  ${ZDOTDIR:-$HOME}/.zlogin     (login)
  /etc/zlogout                  (login - loaded on logout)
  ${ZDOTDIR:-$HOME}/.zlogout    (login - loaded on logout)
In fact, the configfiles you mention are only loaded the way you've mentioned them, if the option GLOBAL_RCS is unset. And if GLOBAL_RCS is unset, macOS does not override your PATH, because/etc/zprofile is not loaded :)

1: <https://zsh.sourceforge.io/Doc/Release/Files.html>


Thank you! That's informative.


Oops, I just remembered this, and I got the order of the last two files wrong. ${ZDOTDIR:-$HOME}/.zlogout is loaded before /etc/zlogout when logging out of a login session :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: