neo2023 Posted May 26, 2023 Share Posted May 26, 2023 Hi forum, Does anybody know how I can set the Terminal prompt like the image below? Clock at the beginning with a white and green (Aqua) highlight on the text. Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/ Share on other sites More sharing options...
Steven P. Administrators Posted May 26, 2023 Administrators Share Posted May 26, 2023 I don't know about the clock, but the colors can be manipulated through the Properties dialog of PowerShell This site talks about the "new" Terminal tab which includes experimental features, https://devblogs.microsoft.com/commandline/new-experimental-console-features/ so it could have been something that was there and then removed, or some other trick is needed to get the Clock prefix. neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823888 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 I believe this is done with Oh My Posh which is a prompt theme engine. Check out Oh My Posh. Fleet Command, Sikh, neo2023 and 1 other 4 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823897 Share on other sites More sharing options...
binaryzero Posted May 26, 2023 Share Posted May 26, 2023 +1 Oh My Posh\Powerlines. Been using it for years... neo2023 and Sikh 2 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823925 Share on other sites More sharing options...
+DonC Subscriber² Posted May 26, 2023 Subscriber² Share Posted May 26, 2023 On PowerShell you can define a "prompt" function to do that kind of thing but the OP is using the command shell. EDIT: Just realised it was a Neowin screenshot and not OP's actual shell. Oh My Posh is good advice. neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823941 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 On 26/05/2023 at 11:58, Steven P. said: I don't know about the clock, but the colors can be manipulated through the Properties dialog of PowerShell This site talks about the "new" Terminal tab which includes experimental features, https://devblogs.microsoft.com/commandline/new-experimental-console-features/ so it could have been something that was there and then removed, or some other trick is needed to get the Clock prefix. Thanks. I think you are talking about CMD/PowerShell, not the (Windows) Terminal. The Terminal doesn't have such right-click menu, it has a "Settings", and by clicking on it, it goes to the Terminal setting page that has nothing about the feature. On 26/05/2023 at 15:16, binaryzero said: +1 Oh My Posh\Powerlines. Been using it for years... Thanks. I'm not a power user of the command line. I use it for some CLI apps (like FFMPEG). I love this theme. Could you help me to make my Terminal prompt like the original SS above (from NeoWin)? I can add the clock by this command: prompt $T$H$H$H$S$P$. I know nothing more! On 26/05/2023 at 16:16, DonC said: On PowerShell you can define a "prompt" function to do that kind of thing but the OP is using the command shell. EDIT: Just realised it was a Neowin screenshot and not OP's actual shell. Oh My Posh is good advice. It's (Windows) Terminal. The SS is about Terminal version 1.17 (NeoWin blog post). https://www.neowin.net/news/windows-terminal-preview-117-now-out-with-mica-support-and-process-restart/ Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823958 Share on other sites More sharing options...
adrynalyne Posted May 26, 2023 Share Posted May 26, 2023 I use Starship. Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823974 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 On 26/05/2023 at 18:10, adrynalyne said: I use Starship. I don't use 3rd-party app. The Neowin post uses Windows Terminal (like me). I think it has been modified by some "Prompt" command in "Environment Variables". Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823978 Share on other sites More sharing options...
neufuse Veteran Posted May 26, 2023 Veteran Share Posted May 26, 2023 On 26/05/2023 at 10:57, neo2023 said: I don't use 3rd-party app. The Neowin post uses Windows Terminal (like me). I think it has been modified by some "Prompt" command in "Environment Variables". all the ones you see are from oh-my-post, there is even articles on MS's site on how to set it up https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823989 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 @neufuseThanks. Is that work for CMD? The blog post says it's for "Powershell" and "WSL". Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598823992 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 (edited) I now notice that it is CMD this is being used and not Powershell. There is a way to modify the CMD prompt; prompt | Microsoft Learn Try this in cmd; prompt $c$t$f$g$p$g I didn't get it exactly the same as in your screen shot. Still trying to get the last piece. Ok. Got it. prompt $c$t$f$g$p$g$_%username%@%computername%$g Edited May 26, 2023 by Spannercrank neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824014 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 @Spannercrank Many thanks. Yours is closer to the Neowin SS. I think I have to ask the post author, but I don't know if he is here (in this forum)! Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824023 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 On 26/05/2023 at 12:37, neo2023 said: @Spannercrank Many thanks. Yours is closer to the Neowin SS. I think I have to ask the post author, but I don't know if he is here (in this forum)! Try this one; prompt $c$t$f$g$p$g$_%username%@%computername%$g neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824029 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 @Spannercrank Cool 🤩. Did you find out anything about the highlight (white on the clock and aqua in the username)? Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824034 Share on other sites More sharing options...
adrynalyne Posted May 26, 2023 Share Posted May 26, 2023 (edited) On 26/05/2023 at 07:57, neo2023 said: I don't use 3rd-party app. The Neowin post uses Windows Terminal (like me). I think it has been modified by some "Prompt" command in "Environment Variables". I’m using Windows Terminal as well. https://starship.rs/ neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824050 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 On 26/05/2023 at 13:00, neo2023 said: @Spannercrank Cool 🤩. Did you find out anything about the highlight (white on the clock and aqua in the username)? Working on it. Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824054 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 On 26/05/2023 at 13:30, Spannercrank said: Working on it. I don't think I got one of the colors exactly right but try this; prompt $e[30m$e[47m$c$t$f$e[37m$e[46m$g$p$e[36m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824063 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 On 26/05/2023 at 21:17, Spannercrank said: I don't think I got one of the colors exactly right but try this; prompt $e[30m$e[47m$c$t$f$e[37m$e[46m$g$p$e[36m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g Oh God!!! You are a genius 😍👏🏻... Many many thanks. You would be God if you find out the aqua colour and the brackets code. Thanks... 👍🏻 On 26/05/2023 at 21:17, Spannercrank said: Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824067 Share on other sites More sharing options...
+DonC Subscriber² Posted May 26, 2023 Subscriber² Share Posted May 26, 2023 On 26/05/2023 at 18:54, neo2023 said: Oh God!!! You are a genius 😍👏🏻... Many many thanks. You would be God if you find out the aqua colour and the brackets code. Thanks... 👍🏻 You can get the aqua colour with a 24 bit colour code: prompt $e[30m$e[47m$c$t$f$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g The 24 bit version of the background colour change is the following bit. You can adjust the RGB values (Red 0, Green 128, Blue 128 in the examples above) from 0 to 255 to fine tune it. Substitute "48" with "38" to change the foreground colour instead of the background colour. $e[48;2;0;128;128m neo2023 and Spannercrank 1 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824078 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 On 26/05/2023 at 14:28, DonC said: You can get the aqua colour with a 24 bit colour code: prompt $e[30m$e[47m$c$t$f$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g The 24 bit version of the background colour change is the following bit. You can adjust the RGB values (Red 0, Green 128, Blue 128 in the examples above) from 0 to 255 to fine tune it. Substitute "48" with "38" to change the foreground colour instead of the background colour. $e[48;2;0;128;128m I was wondering why I could not get the color right. Thanks. Here is the final version with the square brackets; prompt $e[30m$e[47m[$t]$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824081 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 On 26/05/2023 at 21:58, DonC said: You can get the aqua colour with a 24 bit colour code: prompt $e[30m$e[47m$c$t$f$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g The 24 bit version of the background colour change is the following bit. You can adjust the RGB values (Red 0, Green 128, Blue 128 in the examples above) from 0 to 255 to fine tune it. Substitute "48" with "38" to change the foreground colour instead of the background colour. $e[48;2;0;128;128m Co0o0o0o0o0o0l 🥳... Many thanks for the colour code. On 26/05/2023 at 22:04, Spannercrank said: I was wondering why I could not get the color right. Thanks. Here is the final version with the square brackets; prompt $e[30m$e[47m[$t]$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m$_%username%$e[37m@$e[32m%computername%$e[37m$g Many many many thanks 🥳👍🏻👌🏻. I removed "%username%" and "%computername%" but it didn't remove the second line. Do you know how we can remove it? Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824086 Share on other sites More sharing options...
Spannercrank Posted May 26, 2023 Share Posted May 26, 2023 On 26/05/2023 at 14:45, neo2023 said: Co0o0o0o0o0o0l 🥳... Many thanks for the colour code. Many many many thanks 🥳👍🏻👌🏻. I removed "%username%" and "%computername%" but it didn't remove the second line. Do you know how we can remove it? From the end of the prompt line remove up to and including the $_. So you should have; prompt $e[30m$e[47m[$t]$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824087 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 @Spannercrank Thanks 👍🏻. My last question. I see the command text and background colour I type is changing to a new colour (Aqua text on Black Background). Should it be there, or can I change it to the default (Terminal's default colours)? Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824092 Share on other sites More sharing options...
+DonC Subscriber² Posted May 26, 2023 Subscriber² Share Posted May 26, 2023 On 26/05/2023 at 20:07, neo2023 said: @Spannercrank Thanks 👍🏻. My last question. I see the command text and background colour I type is changing to a new colour (Aqua text on Black Background). Should it be there, or can I change it to the default (Terminal's default colours)? For that you need to put the colour reset code on the end: prompt $e[30m$e[47m[$t]$e[37m$e[48;2;0;128;128m$g$p$e[38;2;0;128;128m$e[40m$g$e[96m$e[0m neo2023 1 Share Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824100 Share on other sites More sharing options...
neo2023 Posted May 26, 2023 Author Share Posted May 26, 2023 @Spannercrank and @DonC , Many many thanks guys. You made my day. 🙏🏻 Link to comment https://www.neowin.net/forum/topic/1429613-windows-terminal-custom-prompt/#findComment-598824103 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now