Questions tagged [prompt]

A string of characters displayed by interactive shells to signal the shell is waiting a user input.

Filter by
Sorted by
Tagged with
1
vote
1answer
54 views

Uptime information updated in the command prompt

I want to put the uptime command information into the command prompt and have it updated every 750ms (regardless of whether I'm typing at the prompt or not). I usually use bash but I've used zsh too, ...
9
votes
2answers
680 views

zsh prompt: check whether inside git repository and not being ignored by git

In my zsh shell, I am dynamically changing prompt depending on whether I am inside git repository or not. I am using following git command to check: if $(git rev-parse --is-inside-work-tree >/dev/...
0
votes
0answers
28 views

How do I get Powerline to produce the proper prompt arrows in Bash

There are several questions on this web site that are very similar to mine; however, the answers to those questions do not seem to solve my problem. To start out with let me describe my process thus ...
0
votes
1answer
23 views

Bash: adding history -a to PROMPT_COMMAND makes incorrect calculation of last command's wall time

To calculate last command's wall time I use this code (code #1): # # Taken from https://stackoverflow.com/a/34812608/9881330 # Slightly modified. # function timer_now { date +%s%N } function ...
3
votes
3answers
136 views

Specify answer in shell script for Ubuntu

So I am trying to make a standard shellscript to install some standard software which are useful for me like net-tools, OpenSSH, Omada Controller and so on. As the standard .deb for the TP Link Omada ...
3
votes
1answer
91 views

Return control after command ends in Ubuntu

Apologies for this newbie question but I can't find the answer anywhere. If I run the command systemctl in a SSH terminal accessing an Ubuntu VM in Azure, then it ends with lines 159-187/187 (END), it ...
0
votes
1answer
43 views

Terminal prompt wrapping incorrectly

I have an issue with my Ubuntu default terminal overwriting the current line when the prompt (specifically, the path that I am cding into) is quite large. I have closely followed the issue here: ...
0
votes
0answers
59 views

Why is Kali Linux not displaying symbol in the terminal?

My Kali Linux zsh terminal is not showing the default symbol. It displays a weird undefined box instead of the symbol My Prompt Original Prompt I am not being able to figure out the exact problem. I ...
3
votes
2answers
173 views

Cannot get .bashrc PS1 configuration to render without issues

I essentially know what the problems is, in that I need to use \[...\] as a way to escape (non-space?) characters, and allow bash to correctly calculate the width of my prompt. However, I cannot iron ...
1
vote
0answers
19 views

'(base)' appears at the prompt in Linux terminal [duplicate]

suddenly I have a "(base)" before the prompt of my terminal: (base) name@computer:~ $ my prompt was defined in bashrc as case "$TERM" in xterm-color|*-256color) color_prompt=...
0
votes
1answer
21 views

Cursor appears at the beginning of command line [duplicate]

I'm having difficulty with specifying PS1 on Ubuntu 18.04.5. I use the following code in my .bashrc file and the result looks exactly as it should. export PS1=$'\e[38;5;046m \u00AB\D{%y-%m-%d}\u00BB-[\...
1
vote
0answers
28 views

How do I get “other” colours in my bash prompt? [duplicate]

I've never coloured my bash prompt before, but after a quick googling I'm running: PS1='\[\033[0;31m\]\u@\H:\[\033[0;33m\]\w\$\[\033[00m\] ' giving me red username/host followed by yellow working ...
0
votes
2answers
35 views

How to see what current prompt definition

I'm moving from bash to zsh and getting stuck on the prompt. My Manjaro defines it one way, Ubuntu another. So I like, e.g. the prompt called "clint". But it's not exactly what I want. I can ...
1
vote
0answers
36 views

Bash prompt - octal representation of multibyte unicode characters works for prompt but not when run manually (same script)?

Given the shell script myPrompt.sh: #!/bin/bash printf "Llama \001\360\002\001\237\002\001\255\002\254 Llama $> " ... and the bash prompt configured to run above script: alias myPrompt=&...
0
votes
0answers
48 views

Avoid saving commands with newlines to bash history

I'm trying to filter certain commands from bash history. I've read about HISTIGNORE, but I would like to avoid saving commands that have new lines, or commands longer than N characters. I frequently ...
0
votes
1answer
56 views

How to update prompt PS1 in bash scripts

I would like to update the bash prompt inside a script. Essentially, I have to use a VPN to remotely work on another computer and would like it to get reflected by the bash prompt. Unfortunately ...
2
votes
0answers
65 views

Prompt Linux login has this < character instead of username@machine:

I have a problem with my Linux device. After the boot-up sometimes the shell show me only this < character, I can run normal shell commands like ls/cat etc, but it shows me only 1 character. When I'...
0
votes
1answer
41 views

What is causing corrupted symbols in prompt? Suspect I'm missing an escape somewhere

I am getting some "corrupted" symbols diplaying both in my terminal prompt and also in the lowest portion of my vim instance. These seem to be some sort of color code reference, but I can't ...
1
vote
1answer
48 views

How does the escape character '\' work in bash prompt?

I started tweaking around with my bash prompt lately and I find myself not understanding how the escape character works. I have the following: PS1="\[$RED\]\342\224\214\342\224\200" In this ...
0
votes
1answer
72 views

How to remove path from /bin/bash line?

Is there a way to hide the path in the CLI line? Right now I get this: fresh_m2@bloedlvm:/srv/www/vhosts/$ I want it like this: fresh_m2@bloedlvm$ Because if I go very deep into the folders, then ...
3
votes
1answer
58 views

Changes to PS1 in bash.bashrc are not reflected on the terminal's prompt

I want the prompt of all users to output date and time, and in file /etc/bash.bashrc I set: PS1='\D{%Y%m%d}-\t~\u@\h \$ ' I reboot the system, and after I open a terminal, I see that my prompt has ...
0
votes
1answer
65 views

Customizing hostname in zsh prompt

I am using zsh with oh my zsh and I wanted to get a thing like this: How can I do it? I want a setting to put somewhere, so that whenever I restart my terminal and my system, it always displays the ...
7
votes
1answer
130 views

How can a shell output affect the typed text after the command prompt?

I have experienced similar behaviour before, but only now I can reproduce it: Output from a command affecting the text after the next command prompt, ready to be Entered by the user. Take the ...
-2
votes
2answers
39 views

How can I block ~ symbol when I'm on /home/user directory?

I want to block ~ symbol when I'm in /home/user directory. I want this because I'm trying to make my Linux system look like Windows 10. My current prompt look like C:~/> I want to make it look ...
2
votes
1answer
48 views

The values don't get updated in my custom command prompt when I hit enter

I am trying to make a custom command prompt that looks like this: [][][][]$, where the [] can be filled with custom information. For example, if I write in the console . file.sh 0 2 "date -R"...
1
vote
1answer
246 views

Overwrite bg color of zsh prompt

I'm using zsh with prompt fade, I do not have oh-my-zsh installed. My terminal background is dark blue, not black, but the prompt is being printed on a black background. How can I overwrite this so ...
0
votes
1answer
36 views

must PS1 string be reevaluated each time input enter

How to make the PS1 string always be reevaluated each time the user inputs the enter key at the shell prompt? actual in mine: n=A; PS1="$n" n=B The prompt keeps showing A. How to solve it?
1
vote
2answers
40 views

pad the prompt with dots if the length of the prompt is less than n

Thanks to Klas Mellbourn my current prompt looks like # this variable can be changed later to change the fraction of the line export PROMPT_PERCENT_OF_LINE=40 # make a function, so that it can be ...
2
votes
1answer
77 views

PasswordAuthentication=no flag does not work on one strange host

On my source REDHAT Linux 7 host i fire this command to never prompt for password and passwordless login ssh -i /app/axmw/ssh_keys/id_rsa -o PasswordAuthentication=no root@<target-host> -vvv ...
1
vote
0answers
21 views

After adding a custom prompt in my .bashrc, the typing seems to repeat in the second line [duplicate]

So I edited my .bashrc and decided to add the following code: bold=$(tput bold); if [ "$EUID" -ne 0 ]; then PS1="\[${bold}\e[38;2;171;178;191m[\e[m\]"; PS1+="\[${bold}\...
1
vote
0answers
58 views

Troubleshooting my PS1

I have a PS1 that looks like: johnsmith@someserver:~ $ echo $PS1 \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n$(exitstatus) ...
-1
votes
2answers
39 views

is it possible that at the end of the prompt has a “$” when using root user?

I saw a prompt having the structure root@machine : /root $, does it mean that it is being used the root user?
1
vote
2answers
62 views

How to put updating data in the Bash command prompt?

I am trying to make a prompt that would show the current battery percentage, however if I have my code for setting PS1 in .bashrc the way that it's written then it only checks the data once when the ...
1
vote
1answer
63 views

zsh prompt losing customization when using `sudo su`

My current zsh prompt is: prompt='%F{013}%2~%f$(git_super_status)%(?.%F{004}.%F{001}✕%?)$ %f' It looks something like: Documents/multi-git-status:master↑5●2✚1…$ However, when I use sudo su it ...
4
votes
1answer
66 views

add status of sudo session to PS1 without extending session

I can add the status of a sudo session to the bash prompt like this: function sudo_active() { if sudo -n /bin/true 2> /dev/null then printf '(sudo) ' fi } PS1="$PS1"'$...
1
vote
1answer
173 views

zsh does not reload functions in the prompt

I am trying to make the zsh prompt reload a function everytime a new prompt loads. The function outputs a version of pwd but shorter, if the output of pwd was ~/Downloads/Folder the function would ...
0
votes
1answer
112 views

Special characters don't work in bashrc

I've been looking to a tutorial on how to customize my terminal. When I try to customize the PS1 into something like PS1="\u@\h \W -> " export PS1; After I source the file in the terminal, ...
0
votes
1answer
40 views

Setting command color?

I'd like to set my command line colors in a way that the command I type is in different color than everything else. This is my current PS1 setup: PS1="\n\[\e[1;33m\]\w\[\e[1;30m\] \D{%F %T}\[\e[0m\]\...
1
vote
1answer
31 views

How to put the time string into the fish shell's prompt?

Currently I use this theme for fish, installed using fisher. This is how it shows up now: I would like the time string (e.g. 19:19) to be shown before the /m or after react or after the part with ...
2
votes
2answers
246 views

Asterisk: how to change the CLI color prompt?

The Asterisk wiki says that the color of the CLI prompt can be changed with %Cn[;n]. ie: export ASTERISK_PROMPT="%C31[%H]: " but when I use the export above, I get broken prompt [1;31m[voip]...
0
votes
1answer
57 views

My terminal has stopped sourcing my .profile file

I installed starship (https://starship.rs/) the other day to make my prompt more useful, and as cool as it is, it broke a number of things about my terminal so I uninstalled it. Unfortunately, even ...
2
votes
2answers
39 views

How to include my virtual console ID in the prompt, in FreeBSD

When I use virtual consoles ALT-F<1~n> in FreeBSD, I want my 'zsh', 'sh' (and possibly other shells) startup scripts to include the virtual console number in the prompt, if it's not the default ...
1
vote
1answer
592 views

Can a unicode character be used for the zsh prompt instead of the '%' symbol?

Macbooks now default to zsh for new users. Existing users have the option of switching to it. I've made the switch and would like to make my prompt look the way it did in bash. I have this for the ...
0
votes
0answers
26 views

creating a command regarding FastANI output?

This question is regarding fastANI of working on metagenomics, using fastANI. I have calculated the average nucleotide identity using 25 samples as REFERENCE and the same 25 samples as QUERY. I have ...
0
votes
2answers
116 views

Launch new terminal instance with zsh using custom prompt string

I want to be able to launch a terminal emulator (preferably gnome-terminal) with interactive zsh running inside using a custom prompt string. I don't want to modify my default prompt string in .zshrc ...
3
votes
1answer
81 views

Terminal fish prompt blank

So I'm trying to change my fish shell terminal prompt but every time I change anything too complicated (beyond colour changes and rearranging the prompt), it just turns up blank. I'm running Arch ...
1
vote
1answer
38 views

How do I get different colored prompt depending on server?

I use ssh all the time, but I sometimes forget which server I am on. Can I using the same .bashrc (/home is NFS shared) have different colored prompt on different servers? Preferably without listing ...
1
vote
1answer
377 views

Difference between %F{color} and %{$fg[color]%} in zsh prompt

I noticed that there are two ways of setting the foreground color in your zsh prompt. PROMPT='%F{blue}$' PROMPT='%{$fg[blue]%}$' Both of these lines will produce a blue $ as your prompt. Is there ...
0
votes
2answers
118 views

Does Korn shell have an equivalent feature to Bash's command_not_found_handle?

And does Korn shell have an equivalent to PROMPT_COMMAND? In Bash, I'm able to make function calls with a parameter when a single input word matches a regular expression. Can Korn shell do this? Let'...
0
votes
0answers
24 views

PS1 possibly making Bash text wrap to same line [duplicate]

I just configured my .bashrc file (PS1) to get a fancier bash prompt and now I have an issue, all my text is wrapping to the same line in the terminal here is my PS1: PS1='${debian_chroot:+($...

1
2 3 4 5
12