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
0
votes
0answers
17 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:+($...
0
votes
1answer
30 views

Unicode character in PS1 makes wrapping behave weirdly (not a duplicate)

I wanted to put the Unicode character Δ into PS1, but when I did, when typing in long commands, the terminal wouldn't wrap to a newline but would overwrite the current line! The problem doesn't occur ...
0
votes
1answer
28 views

Transcribe bash to zsh

I was wondering how could I write this: export PS1="\[\033[38;5;51m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;10m\]\h\[$(tput sgr0)\]\[\033[38;5;226m\]\w\[$(tput sgr0)\]\[\033[...
1
vote
0answers
17 views

User defined functions in zsh prompt

I'm trying to use a functions that returns the number of commits in a given branch in the zsh prompt. This is what I have now: setopt PROMPT_SUBST autoload -Uz vcs_info precmd() { vcs_info } zstyle ':...
1
vote
1answer
41 views

What is this password prompt after logging in to Debian 9?

Every time I restart the system and log in, a password prompt pops up: In most cases, this happens as soon as I open Chromium (it actually seems to freeze up the browser), and usually clicking on "...
0
votes
0answers
22 views

Long commands typed in bash overwrite the same line Centos Minimal [duplicate]

Long commands typed in bash overwrite the same line its happens when I install Centos Minimal with gui its working as expected. for example this command " rpm -ivh https://repo.zabbix.com/zabbix/4.4/...
1
vote
2answers
28 views

Cropping long strings in zsh

I would like to set my prompt to something like %1~ \#, which would show the current directory, without the full path (followed by % or #). But, if the name of the directory is long, I don't want all ...
1
vote
1answer
29 views

Is it possible to make mksh use the tilde (~) for home in the PS1?

for example, instead of displaying user@hostname:/home/user in the prompt as per the example in the manpage, could one make mksh display user@hostname:~ ?
0
votes
0answers
8 views

Python venv module cannot add virtual environment name to PS1, when using PROMPT_COMMAND?

I use the official Git Bash prompt support for displaying the current branch as part of the prompt. My problem is that activating a Python virtual environment (python -m venv <dir>) using ...
0
votes
0answers
26 views

How can I enable colours in ZSH for root user?

I'm trying to move from Bash to ZSH, whichc is the new default shell on Mac OS Catalina. I have some bash settings in my profile, and I'd like to translate these settings into the ZSH, including my ...
0
votes
1answer
17 views

Where customize prompt for all existing and new users?

I'm using Ubuntu 18.04. To customize the prompt of an user I know that I have to edit ~/.bashrc. But to override the ~/.bashrc of all existing users which file should I edit on /etc ? And if I want ...
1
vote
1answer
127 views

oh-my-zsh's prompt is slow: how to fix this

I'm using macOS 10.15.2 with iTerm2, zsh 5.7.1 and oh-my-zsh (theme robbyrussell). I noticed that the prompt print is slightly slow respect to the bash one. For example, if I press enter, cursor ...
2
votes
1answer
88 views

Zsh: timeout for vared builtin

I've got a while loop that uses vared to prompt for user input. I am looking for a way to have it timeout, execute a default variable and loop back to the prompt if there is not user input after a ...
1
vote
1answer
42 views

zsh script prompt reading single keystroke: add newline when appropriate?

I have a script that takes an -i flag (→ $interactive) and if set, asks a yes/no-default-no question for each target, à la rm -i and others. Zsh’s read -q is designed for this exact case—it accepts a ...
0
votes
1answer
37 views

Login prompt's weird behaviour

In TTY, my login prompt has got a strange and annoying behaviour: with my arrow keys, I can move the cursor everywhere on the screen, including the prompt itself, the welcome message, etc. If I press ...
0
votes
1answer
56 views

Unix - can i make the command line readable? [duplicate]

Let's say I have this commandline: ~/development/company/folder: and i run this command ./gradlew appRun then my command line looks like this: ~/development/company/folder: ./gradlew appRun Now, ...
0
votes
2answers
35 views

extra characters in bash prompt

I have been trying to customize my bash prompt below is my config #!bin/bash Nocolor="\[\033[0m\]" # Text Reset # Bold High Intensty BIBlack="\[\033[1;90m\]" # Black BIRed="\[\033[1;91m\]...
0
votes
1answer
50 views

bash prompt wrapping to start of line

I was trying to add some color and the time to my PS1 prompt on Debian 10 in my ~/.bashrc file. It initially looks right, but if I type a line that's more than about 40 characters the cursor moves to ...
1
vote
0answers
43 views

How to show how many times bash has been invoked? [duplicate]

A lot of times I will used wrapper scripts for projects to maintain environment variables during development; shell.sh: #!/bin/bash export PATH=$PWD/bin:$PATH export USERNAME=foo export PASSWORD=...
1
vote
4answers
391 views

How to change linux terminal prompt to match ParrotOS

I know that terminal prompt can be changed using PS1="prefix" and I know how to set it permanently, that is not a problem. I am just wondering, how would I set it to look like in parrot OS? ...
1
vote
2answers
51 views

command number in bash changes after login

I want to display the command number in the bash terminal. By using \! I can get only get the command number after opening the shell. I want to continue that even after quitting shell. For example:- ...
1
vote
1answer
97 views

Help with git in zsh prompt

So, I want to add git to my custom prompt. What I want it to do is: Show the name of the branch Change color of the name of the branch if there are uncommitted changes inside the repo I know there ...
0
votes
0answers
29 views

how to have common prompt with date and time in bash as well as guake?

This is how .bashrc looks at my end - # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not ...
1
vote
0answers
62 views

How to trigger a prompt redraw when the terminal window size changes?

So I created a trap to check if the change is being registered: trap 'echo $COLUMNS' WINCH And the change is indeed reflected. But my prompt is not redrawn, neither from re-issuing the $...
0
votes
1answer
93 views

How to setup a terminal prefix

I'm running kali linux and until I was using the root account, everything was fine, but then I made a personal account (name: koumakpet) and used that terminal instead of koumakpet@kali: ~$ there ...
0
votes
1answer
46 views

Live time in prompt - bash

Is there any way to have the live time in the promt, such that when I execute a command, the time shown is the time the command was executed? So far I'm using S1="[\t me@here]\$ " for example, and ...
0
votes
0answers
21 views

Kubernetes context's awareness in prompt

I don't try to inject some precmd in shell's prompt. I want to source something that will enable later commands in shell prompt to aware that we have kubernetes in its context otherwise disable it. ...
1
vote
1answer
89 views

Instead of username bash-4.2$ is displayed. How can I resolved that?

After connecting to the server through SSH command in Linux ssh: IP address. In my server terminal changed to bash-4.2$. If I try to connect from Putty in windows it connects but shows this -bash: /...
0
votes
0answers
40 views

Customising the incremental search prompt in bash

Bash has an incremental search feature for history entries. I believe (correct me if wrong) this is part of the readline library utilised by bash. Using man 3 readline and searching for terms like "...
2
votes
2answers
62 views

Generate a color code from an arbitrary string

I want my shell prompt to have a different, unique, consistent color automatically based on the hostname of the server. For example, when I log in to a particular server, the prompt should be a ...
0
votes
0answers
30 views

Coloring Bash PS1 from within command substitution

I'd like my PS1 to include ANSI escape sequences dynamically via command substitution. Doing either of these things on their own is trivial: PS1="\[\e[0;36m\]Fancy\[\e[0m\] $ " # Correct colors and: ...
1
vote
2answers
115 views

red terminal font when root

I'd like to make happen in RHEL/CentOS 7.6 anytime you do su and become root I want the terminal prompt color in that terminal to become red for the duration of that su session. Type exit to go back ...
8
votes
2answers
1k views

Setting PS1 color

I'd like to color my zsh prompt. To do that, I use the following code: export PS1=%F{blue}%n%# but to have it right, I have to add %f to the PS1 value like so: export PS1=%F{blue}%n%#%f When ...
0
votes
2answers
89 views

Create bash prompt that shows the directory after my home directory

For example, if my home directory is 'FirstLast' and I am inside of /usr/FirstLast/Dir1/Dir2/Dir3 I want my prompt to read [username@srv1 Dir1] regardless of how deep in my directory I am. So the ...
3
votes
0answers
46 views

Colorize the PS4 prompt?

With the option set -x, each command is echoed to STDERR before execution, prefixed by the expanded $PS4, with the first character being repeated according to the call stack depth. I want the output ...
0
votes
0answers
85 views

PuTTY terminal - Unable to type more than 80 chars in a single line

This is exactly the same issue that I am facing. Almost similar question here as well. I have tried all the answers published in the related "StackExchange" questions. I also have tried to increase ...
0
votes
2answers
64 views

Quoting directory names in bash prompt

I want to quote the current directory in my prompt. Eg, if I do: mkdir $'new\nline'; cd $'new\nline' I want my prompt to display $'new\nline', and NOT print a literal newline. I'm seeing ...
2
votes
1answer
46 views

Bash characters staying when browsing history

When holding k or holding up, previously entered commands are shown, but at some point, the first 10 characters of a command longer than 10 characters stay. This is not always the first command longer ...
1
vote
1answer
48 views

Question on modifying shell initialization files to color root's prompt red during “su”

I am in the midst of learning Linux, specifically the BASH Shell. I have been trying to edit the initialization files so that whenever I su into root, my prompt will turn red. I am using the code ...
1
vote
1answer
47 views

PS1 prompt based on who logged in

I've got a nice PS1 prompt that I want to only be used when user 'gatty' uses su for root. PS1='\[\e[32m\]#\[\e[37m\] ' When other users like 'george' etc login, I want them to get the standard PS1 ...
1
vote
0answers
20 views

How can I set the FTP prompt?

I using Ubuntu 18.04 from WSL and using the default Ubuntu FTP client. The man page mentions setting $FTPPROMPT which I have done in my .bashrc on my local machine and then sourced that file. $ echo $...
-1
votes
1answer
49 views

How move caret to the end of line

I want to add colors and git branch name to terminal. I added PS1 in .bashrc but has an issue in folders without git everything works fine, but where git is caret goes to the beginnings of the line ...
5
votes
1answer
616 views

Using GNU screen, I get raw prompt with backslashes

When I use the screen program, the prompt doesn't get interpreted and is just the following: \u@\h:\w$ How can I correct this?
0
votes
0answers
56 views

SSH: login as user A, but once logged in, prompt appears as ROOT

I use putty to connect to a remote Gnu/Linux (Red Hat) through SSH on port 22, direct to IP. First it asks for user name. I enter it. Then it asks for password. I enter it, Then it connects. But ...
1
vote
1answer
133 views

Can't change PS1 value in Gnome terminal v3.28.1 (Linux Mint 19.2 with Cinnamon)

I can't change de PS1 prompt value of the terminal emulator of Linux Mint 19.2 with Cinnamon. It only works for logins made on the console (F1 to F6). The last lines of .profile file: export PS1='my-...
2
votes
2answers
116 views

How to hide/disable preprompt messages?

When we boot a GNU/linux system it shows lots of messages on stdout. And then, immediately before the prompt it shows something like this: Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 ...
3
votes
2answers
657 views

Add newline to prompt if it's too long

I show my full working directory plus other information (git, etc) in my bash prompt and sometimes it gets very long. I want to add a newline to the end of my prompt so I can type the command on the ...
1
vote
1answer
75 views

How to save and restore the default prompt (when PS1 is not defined)?

In a shared cluster I work on, the environment settings for new accounts does not include a prompt setting, as far as I can tell. In particular, PS1 is not set. And yet, when one logs into a new ...
3
votes
1answer
57 views

Disabling home folder symbol (~) in command line prompt

How can I set Bash so that in the command line prompt the home folder is spelled out (e.g. /Users/John) instead of displayed with the ~ symbol?
0
votes
0answers
50 views

need help with osx command line behavior

For some reason, when I run a command in the osx terminal, the cursor is not automatically moved to a new line. Does anyone know how to get the cursor to move down to a new line after every command ...

1
2 3 4 5
11