Live data from Hacker News

Starship.rs: minimal, fast prompt for any shell

starship.rs

111–120 of 160 posts

Re: Starship.rs: minimal, fast prompt for any shell

#111

Earlier quoted context omitted.

> Git information is extremely useful to me. I could see the case for that if it were accurate. But every implementation I’ve seen doesn’t give you accurate Git information. It gives you the status of the repo as it was when you last ran a command . If you are working on the repo in a separate editor window, then the Git information in your prompt is usually incorrect. Incorrect information is worse than no informati…

I can honestly say that has never once been a problem I have had, and I've had git information in the prompt for over 10 years. Also how is "enter" less convenient than literally any other command that you'd still have to type and run to get up-to-date information in a command line?

> I can honestly say that has never once been a problem I have had, and I've had git information in the prompt for over 10 years.

What do you mean exactly?

Are you saying it doesn’t get out of date? i.e. you never change the state of the repository outside of your terminal session? I don’t think that’s reflective of how most people work.

Are you saying that it gets out of date but that doesn’t matter? If that’s the case, then it’s a strong hint that the information isn’t as useful as you assume. What’s the point in constantly, repeatedly showing incorrect information?

Are you saying that you work around the problem by hitting enter whenever you want an update? Then aren’t you doing the same thing as your colleagues who you mention struggle with Git? Hitting enter in your case is essentially a shortcut for running `git status` over and over, except you are doing it with literally every command you run instead of only when you need to.

> Also how is "enter" less convenient than literally any other command that you'd still have to type and run to get up-to-date information in a command line?

The issue is the space and attention used by repeatedly showing outdated Git information. Space and attention are at a premium in a terminal window; you can’t just dump all the information available to you in there for free.

Re: Starship.rs: minimal, fast prompt for any shell

#112

Earlier quoted context omitted.

I think a huge amount of these prompts are just fiddling with things because people think they are clever, not because they are actually useful. My prompt for years has been: : ▶ I add the hostname if it’s an SSH session and change ▶ to # if I’m root because those are both important contexts that should be omnipresent, but aside from that, I haven’t felt like I’m missing anything at all. The CWD is in the window / ta…

The GIT status prompt is immensely useful. Not as useful, but still occasionally useful, are the prompts for language / tool versions. And how much time did the last command take. I make a regular use of that when I don't need sub-second timings. If that makes me "thinking I am clever" then by all means, spend your life believing that. It increases my productivity though.

> If that makes me "thinking I am clever" then by all means, spend your life believing that. It increases my productivity though.

If it increases your productivity, then it’s the opposite of what I’m talking about.

Re: Starship.rs: minimal, fast prompt for any shell

#113

Starship users: how do you track updates? I manually update occasionally (mostly months)

I have a bookmark-folder of release-sites and changelogs I visit ever some months. Though, they are on github, which has a Newsfeed, so at some point I switch to a feedreader or mail-forwarder to have this more under control. But I'm still searching for something good.

Re: Starship.rs: minimal, fast prompt for any shell

#114
post #88

I am using starship for some time and it is great. The only advice is to avoid `custom` as it is slow: not too much but might be annoying.

Starship maintainer here. `custom` spawns a child process of your shell, so it's probably being slowed down by a slow shell init script. If the custom script you're running doesn't require your full shell customization to work, you can provide a custom shell command [0], passing an argument to not use your shell config. For instance: `fish --no-config` or `bash --noprofile --norc` [0]: https://starship.rs/config/#cus…

Thanks. That might help.

Re: Starship.rs: minimal, fast prompt for any shell

#115
post #58

Am I the only one who is getting tired of "It's X in rust" type projects? It's making me dislike the community. Rust is not a user feature, it's an implementation detail.

> Rust is not a user feature, it's an implementation detail.

Rust is the new C. It communicates that something is fast, but also secure, and new or a modern reimplementation of something old. So, in that sense, is it a user feature because it has established itself in a way that tells the user some important details.

Re: Starship.rs: minimal, fast prompt for any shell

#117

I spend so little time relatively on my own machine’s terminal and even when I do I don’t want it to be totally different from the boxes I SSH into every day. That context switch would be frustrating. Nor do I have the desire to push for something like this to be installed on our fleet of servers. Do the people who use this (along with terminal emulators that require you install things on the host to get the full pow…

If it's a machine that you're going to be working on a lot, you might as well have good tools installed. (And if it's a machine where stuff like starship would be bloat, then it's probably not something people should be SSHing into frequently).

Re: Starship.rs: minimal, fast prompt for any shell

#119
post #32

The "minimal" part is a little funny. Historical minimal shell prompts: $ # % >

I think a huge amount of these prompts are just fiddling with things because people think they are clever, not because they are actually useful. My prompt for years has been: : ▶ I add the hostname if it’s an SSH session and change ▶ to # if I’m root because those are both important contexts that should be omnipresent, but aside from that, I haven’t felt like I’m missing anything at all. The CWD is in the window / ta…

I like this approach. I tried using starship.rs but I have to say it does far more than I want it to and makes me feel like I'm not in control of my shell (e.g. it pulls a schema via an URL without any knowledge from me that it does so).

As a result, I've written my own small and concise PS1 which covers all my use cases:

    ## Add this to ~/.bashrc
    force_color_prompt=yes
    ## show: user+hostname (if ssh), conda, venv, guix, and git
    function prompt_command {
        ## styles and symbols
        local RESET='\[\033[0m\]'     ; local BLD_GRN='\[\033[1;32m\]'; 
        local BLD_YLW='\[\033[1;33m\]'; local BLD_PPL='\[\033[1;35m\]';
        local BLD_CYN='\[\033[1;36m\]'; local BLD_WHT='\[\033[1;37m\]'
        local ITL_YLW='\[\033[3;33m\]'; local SEP='⋮'
    
        PROMPT_DIRTRIM=2
        export PS1=""
        if [ -n "$SSH_CONNECTION" ]; then
            PS1=${PS1}${BLD_CYN}'\u'${BLD_YLW}'@'${BLD_GRN}'\h'${RESET}
        fi
        if [ -n "$CONDA_DEFAULT_ENV" ]; then
            PS1=${PS1}${SEP}${ITL_YLW}${CONDA_DEFAULT_ENV}${RESET}
        fi
        if [ -n "$VIRTUAL_ENV" ]; then
            PS1=${PS1}${SEP}${BLD_WHT}${VIRTUAL_ENV##*/}${RESET}
        fi
        if [ -n "$GUIX_ENVIRONMENT" ]; then
            PS1=${PS1}${SEP}${BLD_GRN}'GUIX'${RESET}
        fi
        if [ -e .git ]; then
            PS1=${PS1}${SEP}${BLD_PPL}$(git branch --show-current)${RESET}
        fi
        PS1=${PS1}${SEP}${BLD_GRN}'\w' # short directory
        PS1=${PS1}${BLD_YLW}'▶ '${RESET}
    }
    export PROMPT_COMMAND=prompt_command

Fast and easy to grok.

Re: Starship.rs: minimal, fast prompt for any shell

#120
post #62

Earlier quoted context omitted.

The fact that this happens should be food for thought for part of the rust community. Because the way I see it, if they keep this up, a few years from now, they could, other than some obscure linux kernel modules almost noone uses and a good grep-alternative, be well along what I lovingly call the "Haskell Route".

Almost every single project that makes it to the front page of HN tells you as part of the opening sentences what language it's in. For a good while it was ", (re)written in Go". There's nothing special or unique in the rust community about this, it's just what people in tech do.

The type of complaining you're doing is also nothing new, because exactly the same occurs under those posts when it's the language de jour. A few years ago when it was all about Go, you could look in the HN comments and see people complaining exactly the same way about Go and the Go community.

Post reply on HN