Code Monkey home page Code Monkey logo

Comments (5)

ericbn avatar ericbn commented on September 25, 2024

Hi @2Belette. In steeef.zsh-theme, replace %m by %2m two have 2 components displayed (or replace by the number you prefer), or by %M to have the full machine hostname displayed.

See more at the Prompt-Expansion documentation.

from steeef.

2Belette avatar 2Belette commented on September 25, 2024

Thanks @ericbn ! I learned something :)
For my usecase it doesn't work as my machine has short name in hostname and I would need to find a way to append the domain name but I can't find a way.
Is there a way to parse anything? like echoing something

from steeef.

lnicola avatar lnicola commented on September 25, 2024

Doesn't %M work?

from steeef.

2Belette avatar 2Belette commented on September 25, 2024

@lnicola it is giving me the same result as %m

for example :
username : belette
name of the computer : x1
domain name on resolv.conf (mydomain.com)

zim prompt with %m :belette at x1 in ~$
zim prompt with %M : belette at x1 in ~$

No difference

from steeef.

lnicola avatar lnicola commented on September 25, 2024

Note that the domain (called search now) line in resolv.conf doesn't set the domain name of your current computer, but configures the DNS resolver. The FQDN is in /etc/hostname (or you can check it with hostnamectl if you're running systemd).

I think you can also embed commands in the prompt (PS1='$(ls)'), but reading that file on each prompt would be quite slow. I would rather make sure the domain is configured correctly instead.

from steeef.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.