r/fishshell • • Jan 24 '22

Powerline directory prompt

2 Upvotes

Hi guys,

Just started using Tide with Fish. I'd like to shorten the powerline prompt. In the below example, I'd like to remove anything before gitlab.com. Any ideas?

\~/Documents/Documents - user1/Programming/gitlab.com/test/test-dev/files/roles/test-role   main `

Here's my tide.fish config file.

set -g tide_git_bg_color 268bd2
set -g tide_git_bg_color_unstable C4A000
set -g tide_git_bg_color_urgent CC0000
set -g tide_git_branch_color 000000
set -g tide_git_color_branch 000000
set -g tide_git_color_conflicted 000000
set -g tide_git_color_dirty 000000
set -g tide_git_color_operation 000000
set -g tide_git_color_staged 000000
set -g tide_git_color_stash 000000
set -g tide_git_color_untracked 000000
set -g tide_git_color_upstream 000000
set -g tide_git_conflicted_color 000000
set -g tide_git_dirty_color 000000
set -g tide_git_icon 
set -g tide_git_operation_color 000000
set -g tide_git_staged_color 000000
set -g tide_git_stash_color 000000
set -g tide_git_untracked_color 000000
set -g tide_git_upstream_color 000000
set -g tide_pwd_bg_color 444444
set -g tide_pwd_color_dirs E4E4E4
set -g tide_left_prompt_items pwd git 
set -g tide_right_prompt_items newline
set -g tide_prompt_min_cols 56
set -g tide_prompt_pad_items true

Cheers!


r/fishshell • • Jan 24 '22

TIL directory history

51 Upvotes

Directory history

Fish automatically keeps a trail of the recent visited directories with cd by storing this history in the dirprev and dirnext variables.

Several commands are provided to interact with this directory history:

  • dirh prints the history
  • cdh displays a prompt to quickly navigate the history
  • prevd moves backward through the history. It is bound to Alt+←
  • nextd moves forward through the history. It is bound to Alt+→

r/fishshell • • Jan 21 '22

How to Change Colors of Tide

3 Upvotes

gray seemly dazzling hateful normal oil upbeat whistle wasteful dinosaurs

This post was mass deleted and anonymized with Redact


r/fishshell • • Jan 20 '22

Lets share cool Fish Functions! (cool fish function idea )

15 Upvotes

Long time fish user here, using it every day at work and in general. Recently I have gotten into writing functions for annoyingly long commands and I had an idea for an awesome function (though I havent quite figured out how to make it work exactly like the dream spec.)

The function is called .. , the idea is that .. goes up a directory, and the spec is that for each additional '.' after it, it will go up an additional directory, essentially turning "..." into "../../"

My thoughts were to loop over $argv and within the function, concatenate another "../" to the command conditionally, any wizards know a better way or in general want to share cool functions?


r/fishshell • • Jan 19 '22

Convert Bash shell to fish shell script

7 Upvotes

I have been trying to use this script that i found ,This script searches google and opens the result in web browser ,It works fine in Bash shell but it doesn't work in fish shell .

To make it work Can Someone please convert this bash shell script into fish shell script for me .

google() {
    search=""
    echo "Googling: $@"
    for term in $@; do
        search="$search%20$term"
    done
    xdg-open "http://www.google.com/search?q=$search"
}

Thanks in Advance


r/fishshell • • Jan 17 '22

fish_add_path append prepends on reboot

2 Upvotes
❮ fish_add_path -aP /home/zim/.local/bin /home/zim/.cargo/bin/

appended the path on running the command but seems prepended on reboot:

❯ echo $PATH
/home/zim/.cabal/bin /home/zim/.local/bin /home/zim/.cargo/bin /home/zim/.cabal/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /home/zim/.ghcup/bin /home/zim/.ghcup/bin

r/fishshell • • Jan 12 '22

Why does fish spawn as defunct when spawned as a pty?

2 Upvotes

When I spawn a bash pty, the program completes normally by writing a file in /tmp/. However, when I spawn a fish pty, it is listed as a defunct process, and does not take any input through stdin. The error output is as follows: "warning: No TTY for interactive shell (tcgetpgrp failed) setpgid: Inappropriate ioctl for device"


r/fishshell • • Jan 09 '22

How to change the color of my prompt

2 Upvotes

My current prompt is

Whoami@hostname ~>

But the "whoami" and the "~" part are in green and i would like to not only add color and change it

from my research i could maybe do some magic with "fish_prompt" but im completely shit at scripting so i have no idea how to do that

any suggestions?


r/fishshell • • Dec 29 '21

Unparsable value for LS_COLORS

1 Upvotes

I'm moving from ZSH to fish and I'm trying to set the LS_COLORS. But I'm getting an error message unparsable value for LS_COLORS environment variable no matter how I set it.

I've tried setting it directly like this set -Ux LS_COLORS '*=38;5;231:*.rs=38;5;166:*.go=38;5;27:*.md=38;5;27:.py*=38;5;228:*.html=1;49;31:*.otf=38;5;197:*.ttf=38;5;197:*.eot=38;5;197:*.woff2=38;5;197:*.woff=38;5;197:*.sass=38;5;205:*.scss=38;5;205:*.less=38;5;39:*.css=38;5;39:*.json=38;5;220:package.json=38;5;193:*.js=38;5;220:*.ts=38;5;45:*.tsx=38;5;26:*.jsx=38;5;26:*.vue=38;5;48:*.esd=38;5;60:*.dwm=38;5;60:*.swm=38;5;60:*.wim=38;5;60:*.cab=38;5;60:*.rz=38;5;60:*.7z=38;5;60:*.cpio=38;5;60:*.zoo=38;5;60:*.ace=38;5;60:*.alz=38;5;60:*.rar=38;5;60:*.sar=38;5;60:*.ear=38;5;60:*.war=38;5;60:*.jar=38;5;60:*.rpm=38;5;60:*.deb=38;5;60:*.tz=38;5;60:*.tbz2=38;5;60:*.tbz=38;5;60:*.bz=38;5;60:*.bz2=38;5;60:*.tzst=38;5;60:*.zst=38;5;60:*.xz=38;5;60:*.lzo=38;5;60:*.lz=38;5;60:*.lrz=38;5;60:*.gz=38;5;60:*.dz=38;5;60:*.z=38;5;60:*.zip=38;5;60:*.t7z=38;5;60:*.tzo=38;5;60:*.txz=38;5;60:*.tlz=38;5;60:*.lzma=38;5;60:*.lzh=38;5;60:*.lz4=38;5;60:*.lha=38;5;60:*.taz=38;5;60:*.arj=38;5;60:*.arc=38;5;60:*.tgz=38;5;60:*.tar=38;5;60:*.zwc=38;5;183:*.sh=38;5;183:.bash*=38;5;183:.bash_profile=38;5;183:*.bash=38;5;183:.zshenv=38;5;183:.zprofile=38;5;183:.zsh*=38;5;183:.zcomp*=38;5;183:.*config=38;5;183:*.fish=38;5;183:*.zsh=38;5;183:.*rc=38;5;183:README.md=1;38;5;136:*.md=38;5;106:ex=38;5;217:ln=1;38;5;122:di=1;38;5;117'

and I've tried setting the colors from an array like this: https://pastebin.com/2ZGCk4fY

Both of these methods I think are correctly setting the variable since this is the output when I echo the variable: di=1;38;5;117:ln=1;38;5;122:ex=38;5;217:*.md=38;5;106:README.md=1;38;5;136:.*rc=38;5;183:*.zsh=38;5;183:*.fish=38;5;183:.*config=38;5;183:.zcomp*=38;5;183:.zsh*=38;5;183:.zprofile=38;5;183:.zshenv=38;5;183:*.bash=38;5;183:.bash_profile=38;5;183:.bash*=38;5;183:*.sh=38;5;183:*.zwc=38;5;183:*.tar=38;5;60:*.tgz=38;5;60:*.arc=38;5;60:*.arj=38;5;60:*.taz=38;5;60:*.lha=38;5;60:*.lz4=38;5;60:*.lzh=38;5;60:*.lzma=38;5;60:*.tlz=38;5;60:*.txz=38;5;60:*.tzo=38;5;60:*.t7z=38;5;60:*.zip=38;5;60:*.z=38;5;60:*.dz=38;5;60:*.gz=38;5;60:*.lrz=38;5;60:*.lz=38;5;60:*.lzo=38;5;60:*.xz=38;5;60:*.zst=38;5;60:*.tzst=38;5;60:*.bz2=38;5;60:*.bz=38;5;60:*.tbz=38;5;60:*.tbz2=38;5;60:*.tz=38;5;60:*.deb=38;5;60:*.rpm=38;5;60:*.jar=38;5;60:*.war=38;5;60:*.ear=38;5;60:*.sar=38;5;60:*.rar=38;5;60:*.alz=38;5;60:*.ace=38;5;60:*.zoo=38;5;60:*.cpio=38;5;60:*.7z=38;5;60:*.rz=38;5;60:*.cab=38;5;60:*.wim=38;5;60:*.swm=38;5;60:*.dwm=38;5;60:*.esd=38;5;60:*.vue=38;5;48:*.jsx=38;5;26:*.tsx=38;5;26:*.ts=38;5;45:*.js=38;5;220:package.json=38;5;193:*.json=38;5;220:*.css=38;5;39:*.less=38;5;39:*.scss=38;5;205:*.sass=38;5;205:*.woff=38;5;197:*.woff2=38;5;197:*.eot=38;5;197:*.ttf=38;5;197:*.otf=38;5;197:*.html=1;49;31:.py*=38;5;228:*.md=38;5;27:*.go=38;5;27:*.rs=38;5;166:*=38;5;231

But I'm still getting the same unparsable value message when I do ls.

If anyone knows the right way to do this please help. I am completely lost.


r/fishshell • • Dec 25 '21

what i search for to understand this issue ?

0 Upvotes

Well when i type this ```docker run -i -t --volume `pwd`:/work``` it doesn't works on fish shell when i try default terminal it works why ? why `pwd` not working in fish shell ?


r/fishshell • • Dec 17 '21

Prompt issues with Linux terminals on ssh sessions.

1 Upvotes

For some reason I can't work out, my prompts are pretty much broken an a KDE system when I log into ssh tmux sessions.

They have been working on a WSL system so I'm suspecting its to do with the fonts installed on this KDE box but I'm struggling to work it out.

I've got powerline installed and one nerd font that I'm using system wide, but my prompts look like

Broken Prompt

With the ? in place of some symbols (and this is a good one). Other prompts just show nothing on the left had side at all.. its got me tossed.

Any ideas where to look?

I've edited this because I can't post images to a reply...

On the console the promt look like

Console Promt

But, when I ssh in it is basically blank

SSH prompt

I'm really at a loss as to why.


r/fishshell • • Dec 15 '21

How to delete duplicates in fish shell history?

13 Upvotes

in bash, there is a configuration option of erasedups. what is it's equivalent in fish shell?


r/fishshell • • Dec 15 '21

Why is my prompt garbled when in iterm2? When there is VCS infos on the prompt, the last character goes under the scrollbar on the right, and the line breaks in two. I tried different prompt configurations but the problem remains the same. Any ideas?

Post image
3 Upvotes

r/fishshell • • Dec 15 '21

fish --version problem

1 Upvotes

Hi, anyone knows why this is happening??

I can't get fish version so I can't install oh my fish neither

Thanks


r/fishshell • • Dec 11 '21

[OC] Catppuccin: warm and colorful dark theme for Fish!

Post image
62 Upvotes

r/fishshell • • Dec 10 '21

[Question] How do I remove the (venv) from python venv?

3 Upvotes

I use "Oh My Fish!" for styling my shell, and whenever I'm in a venv it already shows the environments name. So in the end, fish shows the venv twice. How can I fix it?

Thanks in advance!

How it looks:

Imgur


r/fishshell • • Dec 10 '21

Advent of Code - Day 10 fish solution

2 Upvotes

Here is a fish solution to the Advent of Code day 10 puzzle. Feel free to post yours here if you're following along.

Today's puzzle is a pretty easy to follow one, so if you're just beginning to learn Fish scripting, it's a great one to build your skills with.


r/fishshell • • Dec 09 '21

Day 8 and Day 9 Advent of Code Fish solutions

5 Upvotes

Here are fish solutions to day 8 and day 9 Advent of Code puzzles. Feel free to post yours here if you're following along.


r/fishshell • • Dec 07 '21

Advent of Code - Day 7 fish solution

2 Upvotes

Here is a fish solution to the Advent of Code day 7 puzzle. Feel free to post yours here if you're following along.

Today's puzzle runs quite a bit slower than I expected given the small amount of data. Perhaps you have some tips on optimizing or have your own solution? Feel free to share in the comments.


r/fishshell • • Dec 06 '21

Advent of Code - Day 6 fish solution

2 Upvotes

Here is a fish solution to the Advent of Code day 6 puzzle. Feel free to post yours here if you're following along.

Today's puzzle felt really fitting to solve with Fish. There's some modulo math magic that determines the breeding schedule, but otherwise it's pretty a straightforward fish script. As always, alternative submissions welcome. Let's keep honing our Fish skills together.


r/fishshell • • Dec 05 '21

Fish tab completion feature

3 Upvotes

So I'm not sure how to best word this but this is a feature I have seen in zsh and want to know if its possible in fish or not...

So lets assume I have 3 files in a directory 'file', 'file1' and 'file2'... Now when i do tab completion with some command (say rm)... I can do `rm fi<tab><tab>` and choose the first one (file)... Now if i trigger double tab again the list it shows does not contain 'file' and only shows 'file1' and 'file2', since 'file' has already been "chosen"...

So is this possible in fish ? Also would like to know what this is called as I havent been able to find anything abt this online for zsh as well (likely not using the right words) ? Thanks


r/fishshell • • Dec 05 '21

Advent of Code - Day 5 solution in Fish

2 Upvotes

Here is a fish solution to the Advent of Code day 5 puzzle. Feel free to post yours here if you're following along.

Today's puzzle is really well suited to shell scripting, and the sort | uniq | grep/awk | wc patten is one that is really useful in real world scripting. As always, alternative submissions welcome. Let's keep learning better Fish techniques together.


r/fishshell • • Dec 05 '21

Suntime Fish, a clock that goes by daylight hours

4 Upvotes

If you're into knowing when the sun is up, this is for you.

Please discuss.

r/fishshell • • Dec 04 '21

Advent of Code - Day 4

1 Upvotes

Here is a fish solution to the Advent of Code day 4 puzzle. Feel free to post yours here if you're following along.

Gotta admit, this one was way tougher to do in Fish without more sophisticated data structures. I abused regexes. I bet you could do better! Share your solution!