Open tigerinus opened 1 year ago
There are some discussions about this topic at https://github.com/JanDeDobbeleer/oh-my-posh/issues/475
A naive thought on this is:
Have starship prompt --tmux
and starship prompt --right --tmux
to write current left and right prompt to status bar based on TMUX format.
Something like (except currently it does not write in TMUX format)
Have a starship-daemon
to call the above commands on regular basis (per 2 sec, e.g.), ONLY if currently running inside TMUX (check if $TMUX
is set)
Optionally the right prompt could be hidden if $TMUX
is set - just to eliminate redundant information on the screen.
Starship currently uses an external library to handle ANSI text coloring, so it's unlikely we will support tmux formatting anytime soon. For now, it would make sense to instead write a daemon that rewrites ANSI colors into the tmux format and refreshes the status line as desired. This would also work with other similar prompts like ohmyposh.
Starship currently uses an external library to handle ANSI text coloring, so it's unlikely we will support tmux formatting anytime soon. For now, it would make sense to instead write a daemon that rewrites ANSI colors into the tmux format and refreshes the status line as desired. This would also work with other similar prompts like ohmyposh.
That's actually a good idea. I've created a feature request to TMUX.
@tigerinus For me Starship is integrated with TMUX + bash and I can't find any customization from the Starship base terminal that doesn't work with TMUX. In addition I also use Tmuxinator (to easily manage TMUX sessions via a .yml file) and it works as well.
I think I know why some people fail to integrate Starship with TMUX:
~/.bashrc
settings is not being sourced via TMUX!
TMUX runs as a login Shell so it looks for a .bash_profile file or a .bash_login file and colours were being set in ~/.bashrc
file.
This happens to all users (advanced users) who use / have ~/.bash_profile
or ~/.bash_login
files!
source ~/.bashrc
to your .bash_profile
file! (recommended to be added at the beginning)tmux kill-ses -a
source ~/.bashrc
and source ~/.bash_profile
source ~/.tmux.conf
(check location of your TMUX config file, maybe you have it in the .config folder).source ~/.tmux.conf
(point 4).Starship will work perfectly with TMUX. All settings from your Starship config file will work without problems in TMUX, e.g: colours, icons, Git Status, etc.
@carboncrystal believe this issue concerns using starship for/in the tmux status line in the bottom (please have a look at the screenshot above).
Feature Request
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
The only reason I am still staying with Powerline is its integration with TMUX. I've been looking for an alternative to Powerline + TMUX + bash for a long time, but no luck. Starship has a cross-shell prompt customizer that seems to be promising. It'd be nice to support TMUX.
Describe alternatives you've considered
https://github.com/gpakosz/.tmux