Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Directory not printed on first run #62

Closed
ghost opened this issue Dec 30, 2017 · 4 comments · Fixed by #68
Closed

Working Directory not printed on first run #62

ghost opened this issue Dec 30, 2017 · 4 comments · Fixed by #68

Comments

@ghost
Copy link

ghost commented Dec 30, 2017

I looked in the code, and it seems that the current working directory is printed on top for the prompt everytime, unless if it's the first time fish is invoked.
Is there a way to change this behavior?

Also, I noticed that when I clear the screen, the prompt is on the third line. First line is empty, second line is the working directory. Any chance this empty line can also be removed?

Cheers

@edouard-lopez
Copy link
Member

It's come from preprompt

You're right, the new line is added each time a prompt is displayed except if it's a new session. It will be better if we could remove it on clear, you could have a look at the original zsh theme for help.

Feel free to submit a pull request :)

@ghost
Copy link
Author

ghost commented Jan 3, 2018

i realized that i didn't explain myself properly. What I actually wish for, is to have the CWD printed all the time, especially on the first run. No matter what kind of permutations I tried, I still didn't figure out how to make it happen!

Regarding the new line, after testing, I understand it's purpose when the screen is not meant to be cleared since it adds some space. I am not sure how to make it not add a line on clear since I never worked with fish scripts

@rafaelrinaldi
Copy link
Collaborator

I understand what you want but this behavior was purposefully added to be consistent with the original theme. Unless they've changed this to behave the way you expect either by default or via config, I would like to keep it as is for simplicity's sake.

You could probably try setting pre_prompt as a global variable under your own local fish config so it would take precedence over the value we set on the theme.

I'm closing the issue for now but feel free to open another one if I'm missing something here.

@ghost
Copy link
Author

ghost commented Jan 4, 2018

I managed to get the behavior I was looking for by adding

echo $pre_prompt

to my fish.config.

Cheers!

edouard-lopez pushed a commit that referenced this issue Dec 11, 2018
Reimplement workaround for truncated strings (#49) using single function as currently recommended in fish-shell/fish-shell#904 (comment) instead of event handler.

Update first line of the prompt when moving through directory history with "Alt + ←" and "Alt + →" (#66).

Also resolve #62 and #67.

Refactor code into smaller functions.
edouard-lopez pushed a commit that referenced this issue Aug 21, 2023
Reimplement workaround for truncated strings (#49) using single function as currently recommended in fish-shell/fish-shell#904 (comment) instead of event handler.

Update first line of the prompt when moving through directory history with "Alt + ←" and "Alt + →" (#66).

Also resolve #62 and #67.

Refactor code into smaller functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants