[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pimp your shell - Debian developer tips?



On Wed, May 27, 2020 at 10:06:29PM +0300, Otto Kekäläinen wrote:
> Hello!
> 
> Do we have Debian devs here who have pimped their shell heavily with custom
> prompts, colors, command line fonts, shell window title hacks, perhaps
> using zsh etc? Have you written blogs about you experiences, can you share
> some good reads (with screenshots) of what you have done?
> 
> I've read a bit on zsh and powerline and the like, but I am annoyed that
> all those blog posts are quite superficial and do not mention security,
> interoperability or performance aspects. Frankly any blog post that
> recommends cloning random repos or even worse, running wget | sh something
> gives me chills.
> 
> Some above average posts are
> https://linuxhint.com/install_zsh_shell_ubuntu_1804/ and
> https://www.hildeberto.com/2018/02/oh-my-zsh.html
> 
> I'd very much want to read about some more knowledgeable experiences.
> 
> 
> Tips?
>

Not so much _pimping your existing shell_, but I'd like to give a
shout-out for `xonsh` (which I maintain).

It's a python shell - think IPython, but with first-class support for
running commands and passing pipes and arguments back-and-forth to the
python environment.

```
for dctrl in pg`**/debian/control`:
    head -n1 @(dctrl.parent / "changelog")
    sv = $(grep-dctrl -n -s Standards-Version . @(dctrl)).strip()
    if sv != "4.5.0":
        print(f"old s-v {sv}")
```

It's still admittedly a bit rough round the edges sometimes, and being
python there is a memory and performance penalty compared to
bash/zsh/fish/whatever, but I find being able to do flow control and
string manipulation without shell arcana is very useful (and to answer
the original question, the prompt and footer is fully customisable
either with builtin placeholders or the output of arbitrary python
functions).

Gordon

[1]: https://xon.sh/

> 
> Some might react that bells and whistles is useless and real unix beards
> only run plain bash, but I think that good text prompts have a potential to
> increase productivity. And anyway I don't want those MacOS users to claim
> that their shells would be in any way better than what I can have in Debian
> ;)


Reply to: