ilancosman / tide Goto Github PK
View Code? Open in Web Editor NEW🌊 The ultimate Fish prompt.
License: MIT License
🌊 The ultimate Fish prompt.
License: MIT License
Bug description
When installing tide on a brand new fish install, configuring it with tide configure
, selecting the single line configuration, the right prompt doesn't appear.
Note that I have a large screen (430 cols)
To Reproduce
Cleaning my dotfiles and decided to switch from zsh to fish.
Ran into this nice project which looked fine for what I'm used too, so installed it on a brand new (arch linux)/fish install.
After tide configure
, selecting the single line configuration, the right prompt doesn't appear
Expected behavior
A right prompt as shown in tide configure
should actually appear
Environment:
curl -sL git.io/tide | source && tide_install
a few hours before opening this issueGetting an error on initial install. Have wiped fish config directory twice, purged through apt, and on install again am getting this:
> curl -sL git.io/tide | source && tide_install
Installing tide theme...
math: Expected at least 1 args, got 0
math: Expected at least 1 args, got 0
Tide theme installed!
Configure tide prompt? [Y/n]
These errors persist each time the shell is run. Before the fish greeting I see this same error. The prompt customizations work fine however, so not a devastating issue obviously.
Install on Debian using testing repo.
I'm trying to make a series of scripts that re-build my environment from a fresh machine install. For example, doing something like bash -c $(curl -fsSL https://setup.drhayes.io)
should install everything I care about and use daily.
I noticed your GitHub action uses the --unattended
flag and thought it would work for me... but it doesn't, yet.
Making the --unattended
flag work and documenting it would be neato. But I'll take whatever you've got. 👍🏽
I'm a fish newbie but I'm totally willing to help.
As I begin to start working, my posture worsens (back slouches and shoulder curl inwards). This is bad for my health and an arguement could be made that its also bad for my focus.
I would like my prompt periodically to ask me how my posture is so that I correct it.
Id like it to be a configuration option for my prompt to help me stay upright
Right now, I don't see any info about the virtual environment once its activated. Should I be seeing anything?
In $HOME/.config/fish/functions/tide/configure/configs/pure.fish
, I see
tide_virtual_env_bg_color normal
tide_virtual_env_color 00AFAF
tide_virtual_env_display_mode 'projectName'
tide_virtual_env_icon ''
which would suggest that the project name should show up, at a minimum.
I also can confirm that these are set as universal variables for my shell with
❯ set -U | grep "virtual_env"
tide_virtual_env_bg_color normal
tide_virtual_env_color 00AFAF
tide_virtual_env_display_mode projectName
tide_virtual_env_icon
Thanks!
Expected: (the style of echo
should be bold while)
Actual: (the color of echo
becomes the same as the prompt char)
tide bug-report
: ❯ tide bug-report
fish, version 3.1.2
tide, version 3.0.0
alacritty
Tested in alacritty, konsole, tmux in alacritty, and tmux in konsole. The described behaviour is consistent.
Hi there,
First of all, I just want to say thanks for making this theme, I really like it, and the configuration wizard is a great touch!
Unfortunately whenever I try to use the Lean theme I get the follow error (it doesn't happen when I choose Pure).
set_color: Expected argument for option b
~/.config/fish/conf.d/_tide_pwd.fish (line 1):
set_color normal -b $tide_pwd_bg_color
^
in command substitution
called on line 1 of file ~/.config/fish/conf.d/_tide_pwd.fish
in command substitution
called on line 15 of file ~/.config/fish/conf.d/_tide_pwd.fish
in function '_tide_pwd'
called on line 4 of file ~/.config/fish/conf.d/_tide_pwd_set_max_length.fish
in function '_tide_pwd_set_max_length' with arguments 'VARIABLE ERASE tide_pwd_truncate_margin'
called on line 1 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
in event handler: handler for variable 'tide_pwd_truncate_margin'
called on line 17 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
(Type 'help set_color' for related documentation)
set_color: Expected argument for option b
~/.config/fish/conf.d/_tide_pwd.fish (line 1):
set_color normal -b $tide_pwd_bg_color
^
in command substitution
called on line 1 of file ~/.config/fish/conf.d/_tide_pwd.fish
in command substitution
called on line 15 of file ~/.config/fish/conf.d/_tide_pwd.fish
in function '_tide_pwd'
called on line 4 of file ~/.config/fish/conf.d/_tide_pwd_set_max_length.fish
in function '_tide_pwd_set_max_length' with arguments 'VARIABLE ERASE tide_pwd_truncate_margin'
called on line 1 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
in event handler: handler for variable 'tide_pwd_truncate_margin'
called on line 17 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
(Type 'help set_color' for related documentation)
string replace: Expected at least 2 args, got 1
set_color: Expected argument for option b
~/.config/fish/conf.d/_tide_pwd.fish (line 1):
set_color normal -b $tide_pwd_bg_color
^
in command substitution
called on line 1 of file ~/.config/fish/conf.d/_tide_pwd.fish
in command substitution
called on line 15 of file ~/.config/fish/conf.d/_tide_pwd.fish
in function '_tide_pwd'
called on line 4 of file ~/.config/fish/conf.d/_tide_pwd_set_max_length.fish
in function '_tide_pwd_set_max_length' with arguments 'VARIABLE SET tide_pwd_truncate_margin'
called on line 1 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
in event handler: handler for variable 'tide_pwd_truncate_margin'
called on line 23 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
(Type 'help set_color' for related documentation)
string replace: Expected at least 2 args, got 1
set_color: Expected argument for option b
~/.config/fish/conf.d/_tide_pwd.fish (line 1):
set_color normal -b $tide_pwd_bg_color
^
in command substitution
called on line 1 of file ~/.config/fish/conf.d/_tide_pwd.fish
in command substitution
called on line 15 of file ~/.config/fish/conf.d/_tide_pwd.fish
in function '_tide_pwd'
called on line 4 of file ~/.config/fish/conf.d/_tide_pwd_set_max_length.fish
in function '_tide_pwd_set_max_length' with arguments 'VARIABLE SET tide_pwd_truncate_margin'
called on line 1 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
in event handler: handler for variable 'tide_pwd_truncate_margin'
called on line 23 of file ~/.config/fish/tide_theme/configure/choices/all/finish.fish
(Type 'help set_color' for related documentation)
string replace: Expected at least 2 args, got 1
string replace: Expected at least 2 args, got 1
set_color: Expected argument for option b
~/.config/fish/conf.d/_tide_pwd.fish (line 1):
set_color normal -b $tide_pwd_bg_color
^
in command substitution
called on line 1 of file ~/.config/fish/conf.d/_tide_pwd.fish
in command substitution
called on line 15 of file ~/.config/fish/conf.d/_tide_pwd.fish
in function '_tide_pwd'
called on line 26 of file ~/.config/fish/conf.d/_tide_pwd_var_change.fish
in function '_tide_pwd_var_change' with arguments 'VARIABLE SET PWD'
called on line 1 of file /usr/local/Cellar/fish/3.1.2/share/fish/functions/cd.fish
in event handler: handler for variable 'PWD'
called on line 36 of file /usr/local/Cellar/fish/3.1.2/share/fish/functions/cd.fish
(Type 'help set_color' for related documentation)
set_color: Expected argument for option b
~/.config/fish/conf.d/_tide_pwd.fish (line 1):
set_color normal -b $tide_pwd_bg_color
^
in command substitution
called on line 1 of file ~/.config/fish/conf.d/_tide_pwd.fish
in command substitution
called on line 15 of file ~/.config/fish/conf.d/_tide_pwd.fish
in function '_tide_pwd'
called on line 26 of file ~/.config/fish/conf.d/_tide_pwd_var_change.fish
in function '_tide_pwd_var_change' with arguments 'VARIABLE SET PWD'
called on line 1 of file /usr/local/Cellar/fish/3.1.2/share/fish/functions/cd.fish
in event handler: handler for variable 'PWD'
called on line 36 of file /usr/local/Cellar/fish/3.1.2/share/fish/functions/cd.fish
(Type 'help set_color' for related documentation)
string replace: Expected at least 2 args, got 1
I look at funced _tide_item_git_prompt
and see that it calls fish_git_prompt
(in share/fish/functions/fish_git_prompt.fish
), which tells me:
# In addition, if you set __fish_git_prompt_showdirtystate to a nonempty value,
# unstaged (*) and staged (+) changes will be shown next to the branch name.
# You can configure this per-repository with the bash.showDirtyState variable,
# which defaults to true once __fish_git_prompt_showdirtystate is enabled. The
# choice to leave the variable as 'bash' instead of renaming to 'fish' is done
# to preserve compatibility with existing configured repositories.
I have set both
set __fish_git_prompt_showdirtystate 1
set __bash_git_prompt_showdirtystate 1
But dirty files are still not marked with a *
when I’m in a git repo. What’s the trick to enable this?
Open shell:
~ ❯
Change directories:
~ ❯ cd Downloads
~ ❯ pwd
/home/bluebyt/Downloads
~ ❯
Directory displayed in prompt does not update
I removed OMF completely as advised in other treads about this, but the problem still occur. I did saw that I maybe need to reinstall Tide, but I don't know how to do it.
tide bug-report
: fish, version 3.1.2
tide, version 3.1.0
xterm-256color
fisher install ilancosman/tide
(after manually removing whatever universal variables were left behind)fisher remove ilancosman/tide
$ set | rg tide
_tide_left_prompt_display_77962 \e\[38\;2\;108\;108\;108m\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \…
_tide_right_prompt_display_77962 \e\(B\e\[m\e\(B\e\[m\e\(B\e\[m\ \e\(B\e\[m\e\[38\;2\;135\;13…
$ set -S _tide_left_prompt_display_77962
$_tide_left_prompt_display_77962: not set in local scope
$_tide_left_prompt_display_77962: not set in global scope
$_tide_left_prompt_display_77962: set in universal scope, unexported, with 0 elements
The path in the command prompt is not updated.
Tide shows the actual path in the prompt.
tide bug-report
:fish, version 3.1.2
tide, version 2.4.0
xterm-256color
Is your feature request related to a problem? Please describe.
Many users are comfortable with the Pure theme and setting everything up in Tide to recreate Pure is a decent bit of work.
Describe the solution you'd like
Adding a style option in the configuration wizard to make Tide look like Pure would allow these users to seamlessly transition into Tide.
Describe the bug
Since installing Oh My Fish (I think), the current path isn't showing correctly.
To Reproduce
Expected behavior
To start a terminal, navigate to a directory, and have the directory path and info be available on the interface. I'm able to fix this manually by running omg reload
, but I guessing this should happen automatically.
Screenshots
Environment (please complete the following information):
Additional context
I'm brand new to using Fish, having always used zsh and oh-my-zsh prior to now.
I expect the right hand exit status code to be reporting the command just run. However, it appears to lag by a command.
boom
A failure exit code is expected, but a geen checkmark is displayed instead.
You can now type true
and press return, and a red x will appear. Ths is tide
is belatedly reporting failure from an earlier command.
This delay makes the exit status reporting confusing and not useful. If it can't be fixed to update the status of the previous command, it should be removed.
fish, version 3.1.2
tide, version 3.0.0
alacritty
Describe the bug
A clear and concise description of what the bug is.
When using scp or tramp (in emacs) I get superfluous output
string replace: Expected at least 2 args, got 1
string replace: Expected at least 2 args, got 1
string replace: Expected at least 2 args, got 1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
I've narrowed it down to ~/.config/fish/conf.d/_tide_Ω_init.fish when it calls _tide_pwd_set_max_length
I'm not sure of the best way to fix it. It only happens when TERM is dumb or session is non-interactive. I can fix the TERM is dumb by bracketing the _tide_Ω_init.fish with if test "TERM" != "dumb"
but that doesn't fix the non interactive part.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
fish --version
)tide --version
)Use default setting.
After execute tide configure
, it's woks fine. But it's not working when I open a new shell.
Current dir should show that the pwd
command output.
tide bug-report
:Is your feature request related to a problem? Please describe.
Python virtualenv right now is displayed as name of virtualenv in parenthesis and tide prompt follows on new line after that. I am using tide with pormpt on a new line.
Describe the solution you'd like
It should be integrated with prompt along with its own syntax coloring.
Additional context
How bobthefish
has it, but virtualenv being mentioned twice is redundant.
Let me start by saying that I just started using fish so my question may be stupid. I enjoy using tide
, I used configurator to come up with a nice prompt design but now I would like to tweak it a little bit more.
Where is the configuration generated by the configurator placed? The only way I managed to access it is by listing all shell variables with (set -S
).
I would like to tweak it and put the whole configuration to fish.config
so I can easily backup it etc.
The right prompt is misplaced in tmux.
tmux
The right prompt is expected to well aligned with terminal's right border.
But it's not the case in tmux:
tide bug-report
: ❯ tide bug-report
fish, version 3.1.2
tide, version 3.1.0
tmux-256color
On fish v.3.1.2, and using both gnome-terminal and alacritty, the file/directory selection dialog appears to use an erratic selection of colors/highlighting occasionally. An asciinema cast illustrating the issue is at https://asciinema.org/a/vfHWcUTJklZkPRFsUJHJKx0a4.
Thanks for the excellent prompt !!!
Sorry if I missed this in the documentation somewhere---it seems that on my machine, "pure" is the only prompt whose color scheme matches the one that I have set via fish_config
. Is there a way to make the colors of the other prompts track that? I would prefer to not have to set each of the colors individually to match my color scheme :) thanks!
When I enter a directory which is long enough, the prompt stops update.
It seems that the background process stuck in the following while loop and never return.
https://github.com/IlanCosman/tide/blob/main/functions/_tide_item_pwd.fish#L44-L47
cd /tmp
mkdir -p /tmp/and/a/long/enough/deep/nested/directory
cd /tmp/and/a/long/enough/deep/nested/directory
/tmp
The prompt should work as normal in long directories.
tide bug-report
: ❯ tide bug-report
fish, version 3.1.2
tide, version 3.1.0
xterm-256color
Sometimes when navigating through nested folders it can get nasty looking at the path
Have a way to shorten the path of the current directory
cat: /etc/os-release: No such file or directory
math: Expected at least 1 args, got 0
cat: /etc/os-release: No such file or directory
math: Expected at least 1 args, got 0
Welcome to fish, the friendly interactive shell
Type help
for instructions on how to use fish
OS detection should check for /etc/lsb-release if /etc/os-release is not present
function _tide_detect_os_extract_os_release_info -a key
set -l splitOsRelease (cat /etc/os-release | string split '=')
set -l value $splitOsRelease[(math (contains --index $key $splitOsRelease)+1)]
string trim --chars='"' $value | string lower
end
tide bug-report
: fish, version 3.1.2
tide, version 2.3.0
xterm-256color
This seems mostly like a docs issue, but I found in the configuration docs that there is a context
item, which is exactly what I wanted. The wizard doesn't give me that option though, so I went hunting for where the config is actually stored (how to manually add things should really be documented and once I figure it out, I'll gladly make a docs patch) and found it in fish_variables
.
So I changed tide_left_prompt_items
from pwd \x1egit_prompt\x1enewline\x1eprompt_char
to context\x1epwd\x1egit_prompt\x1enewline\x1eprompt_char
and found no difference at all. As a test, I dropped the pwd
part from the variable and immediately saw the change.
Am I missing something?
Is your feature request related to a problem? Please describe.
Sometimes I have multiple background jobs running and it would be useful to see how many there are.
Describe the solution you'd like
I'd like a setting for the jobs
item that displays the number of background jobs running next to the tide_jobs_icon
.
I just installed the prompt and I'm seeing strange offsets / visual defects in terminal.
Is there anything I overlooked in the setup process other than getting the font?
Do you see how the slanted/pointer shapes are misaligned ever so slightly?
tide bug-report
:fish, version 3.1.2
tide, version 2.4.0
xterm-256color
Resizing the window of a terminal will make the terminal look super ugly. The prompt will show up everywhere every time it gets resized.
It should look clean.
tide bug-report
: fish, version 3.1.2
tide, version 2.4.0
xterm-256color
Allow users to change the prompt via JSON config file. If I need to change on feature, I have to go through the tide configure
process again.
It would be helpful if tide configure
save the settings to JSON config file. Therefore, a new command tide restore --configFile
can be use to reimport Fish variables.
Is your feature request related to a problem? Please describe.
Seconds is too large a granularity for me.
Describe the solution you'd like
Add option to always show display execution time of commands. Can switch to seconds if execution time is more than tide_cmd_duration_threshold
I'm using Home-Manager on NixOS and since everything has to be declared ahead of time, I was wondering if that can be done with Tide. I'm assuming if I canconfigure before running fish I can avoid this error (apologize about the ugly nix store names):
[five@desktop:~/home-configuration]$ fish
/nix/store/xvin9f4plkmd5bgmclhis1jz2swj6xny-source/functions/_tide_git_prompt_set_vars.fish (line 2): switch: Expected exactly one argument, got 0
switch $tide_git_prompt_bg_color
^
in function “_tide_git_prompt_set_vars”
called on line 3 of file /nix/store/xvin9f4plkmd5bgmclhis1jz2swj6xny-source/conf.d/_tide_Ω_init.fish
from sourcing file /nix/store/xvin9f4plkmd5bgmclhis1jz2swj6xny-source/conf.d/_tide_Ω_init.fish
called on line 15 of file ~/.config/fish/conf.d/plugin-tide.fish
from sourcing file ~/.config/fish/conf.d/plugin-tide.fish
called on line 305 of file /nix/store/aq7sz6wvcwc5wpbwyy8rxwi8c7clkalb-fish-3.0.2/share/fish/config.fish
from sourcing file /nix/store/aq7sz6wvcwc5wpbwyy8rxwi8c7clkalb-fish-3.0.2/share/fish/config.fish
called during startup
string replace: Expected argument
math: Expected at least 1 args, got only 0
string replace: Expected argument
I'm new to fish so I might need to change something in the fish config file as well.
Some _tide_*
functions remain in the global scope even after uninstalling Tide. This is usually harmless, but in the case of Tide, some functions register event handlers like _tide_quit
. This function will attempt to source files that no longer exist after Tide is removed from your system.
tide/functions/_tide_sub_configure.fish
Lines 89 to 94 in 59ff037
source: Error encountered while sourcing file '/Users/jb/.config/fish/functions/fish_prompt.fish':
source: No such file or directory
source: Error encountered while sourcing file '/Users/jb/.config/fish/functions/_tide_left_prompt.fish':
source: No such file or directory
source: Error encountered while sourcing file '/Users/jb/.config/fish/functions/_tide_right_prompt.fish':
source: No such file or directory
Fixed by #43.
Is your feature request related to a problem? Please describe.
The prompt can be slow at times, especially when in a git repository.
Describe the solution you'd like
An asynchronous prompt that allows the user to run commands without being blocked by the prompt loading.
fish-async-prompt already works fairly well with Tide so adapting it and then baking it in is probably the easiest path.
When I press Ctrl + C on a empty prompt, it simply redraw the prompt.
When I press Ctrl + C on a prompt with some text, it redraw the prompt with a extra unwanted line (see screenshots)
A clean redraw
Before Ctrl + C
After Ctrl + C
tide bug-report
: fish, version 3.1.2
tide, version 2.5.0
xterm-256color
When entering into a directory whose path is bigger than what the terminal can display in one line, tide prompt freezes and the terminal stops respoding
tide bug-report
: fish, version 3.1.2
tide, version 2.3.0
xterm-256color
When opening a new shell, the prompt correctly displays the current directory. After changing directories, however, it does not update
~ ❯
~ ❯ cd workspace/
~ ❯ pwd
/Users/james.childers/workspace
~ ❯
Directory displayed by prompt should update
Operating System: Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
Output of tide bug-report
:
fish, version 3.1.2
tide, version 2.4.0
screen-256color
It doesn't appear that the _tide_pwd
function is getting called when the directory is changed. I only see it get called when a new fish session is instantiated, and not at anytime thereafter.
Right now some code assumes that tide is installed under $__fish_config_dir
.
If installed via fisher it is possible that tide is actually under a different directory root, through the use of $fisher_path
. See this fisher issue for more details.
Don't really know the best way to reproduce this, since I'm not familiar with how to run the tests. Should the tests be run without Tide
installed, or is it okay to run them in a shell where Tide
is already running?
~/config/.fish/conf.d/fisher.fish
_tide_sub_configure.fish
I don't the setup for the tests (Do you run the tests after you've installed tide, or separately?), but I think the test above should fail.
The tests should not assume an installation path, but instead discover it's installation path, and identify paths under that root.
tide bug-report
: fish, version 3.1.2
tide, version 3.0.0
xterm-256color
I had a fork that was addressing some of these issues using a universal variable, but it seems like you've removed almost all instances of this assumption. This test case is the only one left, but it seems like you've mostly eliminated the issue with a different approach, so if you could fix this one last test I think you'll have completely removed the issue.
Installation of the tide prompt creates lots of defunct/zombie processes.
ps axc -o pid,ucomm,tty | grep 'fish <defunct>' | wc -l
and observe the numberps axc -o pid,ucomm,tty | grep 'fish <defunct>' | wc -l
and observe that the number is higher.You can also see the increase in number of subprocesses in htop
.
I would expect the number of zombie processes to be 0. Prior to the installation of Tide
I had no zombie processes. The removal of Tide
removed all the Zombie processes
Operating System: Arch Linux
Fish Version: 3.1.2
Tide Version: 3.0.0
Fisher version: 4.1.0
Fisher plugins installed:
FZF version: 0.24.4 (f502725)
Output of tide bug-report
:
╰─tide bug-report
fish, version 3.1.2
tide, version 3.0.0
xterm-256color
I wasn't sure the best way to figure out what the best way of tracking what the processes are doing, or why they're not being reaped appropriately. I tried attaching via strace to see if I could discern what the processes were being spawned for and what they were doing, but the output was very large. I'd need to filter to the appropriate syscalls, and thought I'd try to post this bug report before I spent too much more time on that approach.
It seems like that I'm seeing an increase of two zombie processes per invocation of the ps
command detailed above. Maybe that's a hint of what's happening?
I'd be happy to try other approaches that you suggest if it would help fix the issue.
Hi @IlanCosman, how do you recommend checking in our tide prompt settings to our dotfiles?
Fish version 3.1.2 on Ubuntu 18
I switched to tide because pure was not handling tmux correctly (the prompt kept printing weird characters) by the way you should advertise this as a feature that it plays nice with tmux.
However below you can see it causes a three line prompt - how can I make that go away but keep vi mode?
Pure handles vi mode by switching reversing the direction of the arrow depending on if youre in insert mode or normal mode - its really minimal and I like it.
Is it possible to add something like this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.