Comments (6)
I've pushed this change. Hopefully the issue is now resolved?
from pureline.
I've just tested with gnome-terminal and it works fine for me. Your choice of terminal app should not have any effect on bash PROMPT_COMMAND.
Can you give more detail? Do you get any error messages in your terminal? Can you cd to the directory with the pureline file and:
source ./pureline
and let use know what happens and what output you get?
from pureline.
Output of source ./pureline
:
Notice that the title bar just has "Terminal"
in it.
If I now change PROMPT_COMMAND
as follows:
export PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
Notice now that the title has changed to show username, hostname and cwd:
If I change directory, the title changes accordingly
If I undo the manual setting of PROMPT_COMMAND
I did above, so that I get the pureline PROMPT_COMMAND
, you can see the PS1
prompt updates (notice the sudden appearance of the red lock to signal read-only) when I change directory to /usr/local/bin
, but the window's title no longer updates.
from pureline.
Actually, through taking you through all these steps, I realised that the title is set to STDOUT of the result of executing ${PROMT_COMMAND}
, escaped between \033 and \007
So whilst pureline_ps1
sets the PS1
variable, I can also have the title set by adding a printf
call at the end
function pureline_ps1 {
...
PS1+=...
...
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"
}
Obviously the printf
statement I've shown here is hardcoded, and a better approach would be to loop over your modules.
My bashfu isn't good enough to figure that out just yet.
from pureline.
I see the issue. I wasn't aware as I don't use window decorations. This is happening because pureline overwrites the PROMPT_COMMAND. This was an intentional change due to feedback. I might look to change this or find an alternative. Anyway ... the quick fix is to change the last line of pureline from;
PROMPT_COMMAND=pureline_ps1
to
PROMPT_COMMAND="pureline_ps1; $PROMPT_COMMAND"
This appends your default setting after pureline.
from pureline.
Thanks Chris
from pureline.
Related Issues (20)
- Multiline commands are visually broken HOT 2
- Needed different symbol for SSH with Hack font on MacOS HOT 1
- Challenged trying to create a module for iterm2 prompt HOT 1
- Unicode symbols HOT 5
- Background jobs count wrong HOT 4
- Git Segment - too many external calls to the git command HOT 3
- Show $SHLVL in prompt if greater than 1 HOT 2
- Right align segments HOT 1
- On some systems the prompt line wraps and overwrites the original line (without adding a new line) HOT 14
- Cursor jumps back three characters when wrapping the first line HOT 8
- Pretty broken in OSX HOT 3
- Using Control Characters resets the cursor HOT 9
- Phantom bg job HOT 1
- Kubernetes segment spams "error: current-context is not set" if kubectl available but not configured yet HOT 1
- duration_segment broken in macOS
- Running on a Pi (bash version 5.0.3) HOT 4
- Merging PR #66 reintroduced a bug in __pureline_pre HOT 1
- segments are not found HOT 1
- Adding a \n before the prompt IS A FUCKING NIGHTMARE HOT 2
- Add tmux, hg segments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pureline.