Skip to main content

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
1 answer
115 views

What is PS1 prompt \[\e]0; vs \[\e]2; , it looks like one is for title name of tab, one is for title name of windows

here is my ps1 does someone know documents about this? export PS1='\[\e]0;YYY@\h:\w\a\]\[\e]2;XXX\W\a\e[32;40m\]\[\e[36;40m\]$?\[\e[31;40m\]\D{%d}\[\e[35;40m\]\D{%H%M}\[\e[36;40m\]\W\[\e[32;40m\]>\[...
user3073309's user avatar
0 votes
2 answers
87 views

SSH shows double shell prompt after entering a command

As you can see in the example below, the shell prompt is duplicated after I use a command. I tried changing the PS1 to something simpler, but the same issue continues to occur: PS1="\u@\h:\W\$ &...
Pineapple29's user avatar
0 votes
0 answers
21 views

How to modify prompt in macOS terminal?

Stupid question, but how would I remove the following from my macOS terminal? (xyz) abc@defgh~% I want to get rid of (xyz). How would I do it?
newuser90's user avatar
1 vote
1 answer
45 views

bash to delete backwards using esc+backspace till the slash on prompt

am new to bash (used tcsh till now) and I would like that using esc+backspace that the cursor will delete backwards till the very next slash (like I had in tcsh). I tried several scripts from ...
user8253554's user avatar
3 votes
1 answer
109 views

Will writing to /dev/pts allow me to source ~/.bashrc?

I have several terminal windows already open; I just made a change to ~/.bashrc, and I'd like to run source ~/.bashrc in each of the open terminals. It seems to me that if I just source ~/.bashrc | ...
Radoslav Ivanov's user avatar
1 vote
2 answers
46 views

How to modify \w in PS1 conditionally?

Everything I work on lives inside the icloud directory, making my bash prompt very long: ~/Library/Mobile Documents/com~apple~CloudDocs/Projects/foo/bar/baz @master $ My prompt is: PS1='\w\[\e[1;35m\...
htor's user avatar
  • 131
0 votes
1 answer
342 views

Change color of root user prompt

I wanted to enable color in the shell as the root user on Ubuntu Server 22.04 after having typed sudo -s. I found this question which led me to the solution of uncommenting the force_color_prompt=yes ...
ubiquibacon's user avatar
0 votes
0 answers
30 views

Can I change default return action on an empty terminal prompt?

Basically, I'd love to be able to be able to configure my terminal to run a ls command when I don't put anything on a terminal prompt and I press enter. If return is pressed in the shell on an empty ...
nameisnorm's user avatar
0 votes
1 answer
229 views

Restoring bash prompt $PS1 to default

Is there a bash shell script or command that I can invoke to restore the original value to $PS1? I clobbered it without making a backup copy. If need be, I can always re-install bash, I'm hoping there ...
John-L_.'s user avatar
-2 votes
1 answer
107 views

Assign multiline string to variable in script [duplicate]

I want a variable, let’s say PS, defined in my .profile file with the following value: PS1='PWD: ${PWD} $ ' So that when I enter $PS in my terminal, I get a two-lined prompt string, the first line ...
Mr. Man's user avatar
12 votes
1 answer
832 views

PS1='\\ $ ' and PS1='\\\\ $ ' are the same in bash

Both PS1='\\ $ ' and PS1='\\\\ $ ' produce visually the same prompt, \ $ in both cases. Why? Is it a bug or documented behavior? Tested on bash 5.2.021 and dash 0.5.12. I have only observed it in ...
Azat Khabibulin's user avatar
0 votes
0 answers
25 views

Unable to force copy multiple files using single command non-interactively

I wish to force copy a set of files having either the same or different names to a single destination on the same host with a single command onn Solaris. Note: the copy should be forced overrite and ...
Ashar's user avatar
  • 511
0 votes
0 answers
78 views

sudo -i is behaving differently than sudo su -

If I as a non-root user (but in the sudoers file) do sudo -i, I get root privileges: laptop:~$ sudo -i [sudo] password for bjmgeek: laptop:~$ whoami root laptop:~$ id uid=0(root) gid=0(root) groups=0(...
Brian Minton's user avatar
0 votes
1 answer
223 views

Correct way to set PS1 prompt over ssh

I am trying to set the PS1 prompt dynamically on the my remote machine. The idea is that when I will do ssh to the remote machine, I will also send the value which will set as a prompt for that remote ...
sachu's user avatar
  • 3
0 votes
1 answer
196 views

FISH CLI What do the error numbers at the prompt mean?

I am just trying out the FISH - (the FriendlyInteractiveSHell) - CLI & whenever I type in an erroneous Command, a new Prompt appears under the faulty Command prompt with a number in square ...
beagleburt's user avatar
0 votes
0 answers
74 views

Cannot update PS1 to change terminal prompt

I am using konsole echo $PS1 gives ${$((_p9k_on_expand()))+}%{${_p9k__raw_msg-}${_p9k__raw_msg::=}%}${(e)_p9k_t[7]}${_p9k__1-${${:-${_p9k__d::=0}${_p9k__rprompt::=${_p9k__1r-${${:-${_p9k__bg::=NONE}$...
Psionman's user avatar
  • 101
1 vote
0 answers
27 views

SSHing via WSL2 into remote debian vm results in "overriding" reverse search

When using WSL2 to SSH into a remote debian VM the reverse search behaves strange, eg. when searching for gitlab with dpkg -l | grep gitlab in history. Behaviour: (reverse-i-search)`gitlabkg -l | grep ...
dahe's user avatar
  • 131
0 votes
0 answers
39 views

How to set dotenv variables in bash shell when changing directory? [duplicate]

I'm trying to set custom environment variables when changing to a particular directory that has a .env file containing the variables. In order for it to be triggered automatically, I included the ...
Marin's user avatar
  • 101
-1 votes
1 answer
717 views

How to Add Space or Padding to Terminal Output?

I don't really know what would be responsible for this. I would bet on my terminal emulator itself (mine is Kitty), but it might be a Zsh (or Oh My Zsh) or Powerlevel10k responsibility. Anyways, what ...
psygo's user avatar
  • 201
2 votes
2 answers
319 views

Configure zsh prompt to show only first 2 letters of current directory

I would like to display only the first two letters of the current directory. I tried PROMPT="%1d %# " which displays the current directory as directory1. But taking a subset of the ...
First Name's user avatar
0 votes
1 answer
81 views

Creating a custom tilde-like directory?

A bit of backstory: For a while now i've just been putting my personal files & directories in the user home directory. However something that has always annoyed be about this is that they get ...
p0sa's user avatar
  • 11
1 vote
0 answers
350 views

(In starship) How do I hide the right prompt if the shell is small?

I have 3 monitors, but one is tiny. My terminal is on the tiny monitor, and starship is configured for a massive right prompt. Can I hide this based on terminal size? I'm aware that the right prompt ...
Perodactyl's user avatar
1 vote
1 answer
144 views

prompt in git hook?

I'm trying to implement an option to skip a pre-commit hook (which will be considered pass and perform the commit) in a pre-commit hook. Everything is running fine except the prompt which reads an ...
Tomáš Pilný's user avatar
0 votes
1 answer
540 views

zsh PROMPT coloring doesn't work inside of tmux

I have the following line in my .zshrc: export PROMPT="%n@%K{9}%m%k:%~# " It works if I connect directly But doesn't work inside tmux How to fix?
Dims's user avatar
  • 3,285
-1 votes
3 answers
2k views

Understand PS1 environment variable

On Stackoverflow, I just saw a question concerning the PS1 environment variable, which is responsible for the Linux terminal prompt. My prompt looks as follows: username@PORT-usr:/dir username is the ...
Dominique's user avatar
  • 141
1 vote
1 answer
295 views

ANSI escape sequences in PS1 cause incorrect length calculation [duplicate]

I have a PS1 set up in my .zshrc which includes multiple ANSI escape sequences. An equivalent definition works nicely in Bash, but in Zsh (v5.8.1) it seemingly causes the shell to calculate the width ...
Konrad Rudolph's user avatar
0 votes
2 answers
1k views

Is it possible to make bash stop blinking text?

I've been playing around with bash a bit and was wondering if it is possible to make blinking text stop if I execute another command. E.g. echo -e '\033[5mEXAMPLE\033[0m' will output a blinking ...
telometto's user avatar
  • 2,055
0 votes
1 answer
199 views

My fish prompt gets messed up when I add more set_color

I've been trying to make a custom fish prompt, but there's one problem that I can't seem to figure out how to fix. I got this to work, but it's not exactly what I want, as I want the ash@cat-box to be ...
Ash's user avatar
  • 1
0 votes
0 answers
100 views

Why does my bash script answer prompt without my asking?

I want to uninstall packages and reinstall them in user mode. I have a manually edited list made with flatpak list, where the first word of the line is the complete name of the package. I can make a ...
Cormor's user avatar
  • 1
1 vote
1 answer
551 views

oh-my-zsh prompt substitution

I'm modifying the intika2 theme in oh-my-zsh to add the current pyenv setting to my prompt. OMZ includes a pyenv_prompt_info command & I added it to the LEFTINFOS variable in the intika2 theme to ...
Todd Vanyo's user avatar
-2 votes
1 answer
1k views

$PS1 vs $PROMPT_COMMAND in bash?

I'd like to customize my shell's prompt. What are the differences between $PS1 and $PROMPT_COMMAND, and what variable should I use? Some historic conventions (of past shells/posix) to find out what is ...
Junaga's user avatar
  • 379
-4 votes
2 answers
3k views

How do I get a new command line to appear in terminal

What is the keyboard shortcut for getting another prompt ari@ari-virutal-machine: to appear:
user3316598's user avatar
0 votes
2 answers
664 views

Confused about bash prompt meaning

I found out that in bash, the $PS1 variable can be modified to change the prompt. The problem is that I'm having some trouble trying to understand the long string of codes that I was given. I did: ...
Kami-kun's user avatar
0 votes
1 answer
430 views

[?2004l characters when login through ssh in debian

I have recently modified the $PS1 environment variable in /etc/bash.bashrc in Debian. To make those changes in my current session, I thought that I could restart bash.bashrc with: . /etc/bash.bashrc ...
user avatar
1 vote
1 answer
719 views

Custom Shell Prompt for Root per sudo/su user

Is it possible to have multiple users using a root shell but with different prompts on the BASH shell for each session/user? We have some training environments with our users using su/sudo to get to a ...
shocko's user avatar
  • 49
3 votes
3 answers
395 views

PROMPT_COMMAND output in shell script using piping LINUX

I want to make a shell script that shows the available data on my root directory and shows it continuously after each new command in the prompt by using PROMPT_COMMAND in the shell script. However, I ...
Baasman404's user avatar
1 vote
1 answer
271 views

Unable to get terminal prompt when executing script via ssh

I have the below script that works fine when run locally cat /tmp/input.sh echo -n ">> " read env exit; I get the command prompt when i ...
Ashar's user avatar
  • 511
0 votes
0 answers
18 views

Getting the prompt on Linux [duplicate]

Real noob question: Am trying to search for a file on Linux am using- systemctl to list all the files but after this list has finished displaying my prompt does not return, so am unable to search for ...
OB1's user avatar
  • 1
0 votes
0 answers
35 views

How do you get your prompt back after executing a command like systemctl on linux? [duplicate]

Real noob question: I was running a script on Linux- systemctl and I want to search for a specific file but before I can type in the new code | grep 'filenames I need to get the prompt back but am ...
OB1's user avatar
  • 1
0 votes
4 answers
312 views

Bash: interactively enter and save large html block into a variable from the terminal

This is simple #!/bin/bash echo "What is your name?" read name echo "Your name is: $name" But what if I don't want to treat a name but a large HTML code block with nested tags and ...
pastic's user avatar
  • 111
7 votes
2 answers
2k views

Get cursor location in tty without reading from stdin (need help with redirections)

I have written a fancy custom bash prompt, and it works really well; I just have an issue when trying to run multiple commands separated by newlines. (I apologise for the length, but I hope my issue ...
techhazard's user avatar
6 votes
1 answer
1k views

How to hide email from shell prompt with starship

Currently, my terminal looks like this: ~ on ☁️ [email protected] took 15s > I want to hide the email from the view such that the terminal view is just ~ took 15s > How do I go about doing ...
LoganN's user avatar
  • 131
2 votes
1 answer
507 views

Customize bash prompt without plugins

I am customizing my bash prompt in order to make it look a little bit fancier. Here is what I did (in the ~/.bashrc file, Ubuntu 20.04). # Customizing prompt t1_bg="\[$(tput setab 31)\]" ...
ado sar's user avatar
  • 133
0 votes
1 answer
632 views

How to convert this bash prompt to work in zsh terminal?

I am trying to get colored text in zsh, and I like the color options given in this bash command PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\]. ...
Krish's user avatar
  • 103
4 votes
2 answers
468 views

Setting up a name in the terminal Linux

My question is pretty silly, but could not find nothing on the internet that explained me how. The thing is that I want to have the name displayed in the terminal as: Server mpi@raspberry: ... $ but ...
Enzo Basile's user avatar
0 votes
0 answers
196 views

How to change Linux terminal prompt

I've been using Terminator as my terminal but after reconfiguring my display manager to 'Lightdm' after 'gdm3' crashed while installing updates, I messed something up, not with terminal, using the GUI ...
George's user avatar
  • 1
0 votes
3 answers
139 views

How to display a prompt and prevent execution against basic but dangerous commands like mv or rm

Objective Whenever I use mv (or commands of similar nature) I want my shell to prompt me something like "Hey, you used mv. Sorry but do it again using mv -i". I'd like to know the reasonable ...
dungarian's user avatar
  • 445
0 votes
1 answer
327 views

opening default path for root user

It may be trivial what I say, but I need to change the default opening path that OH My ZSH has. since no matter where I preposition myself in a file path (example: /home/username/Downloads/owt), when ...
RedBook's user avatar
3 votes
2 answers
854 views

String manipulation with backslash-escaped special character in bash prompting

I would like my bash prompt to show \etc\defaults using PS1 when I am in /etc/defaults. I have tried these two methods PS1="$(echo "\w" | sed 's/\//\\/g')" PS1="$(tmp="\w&...
Noob Life's user avatar
  • 151
-1 votes
2 answers
130 views

Is it possible to output LaTeX in a shell prompt?

There are several "lambda" prompts (i.e., shell prompts which use the $\lambda$ symbol). While these look nice in theory, many fonts do not use the lambda symbol that I like: $\lambdaup$. I'...
Joshua Crotts's user avatar

1
2 3 4 5
14