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

iTerm2 shell integration broken. #116

Closed
JunJi-JiaYue opened this issue Jan 9, 2019 · 17 comments · Fixed by #176
Closed

iTerm2 shell integration broken. #116

JunJi-JiaYue opened this issue Jan 9, 2019 · 17 comments · Fixed by #176
Labels
🐛 bug something that doesn't works as expected ❓discussion understanding the project and its choices

Comments

@JunJi-JiaYue
Copy link

$ fish
functions: Function 'fish_mode_prompt' does not exist
~/.iterm2_shell_integration.fish (line 59):
  functions -c fish_mode_prompt iterm2_fish_mode_prompt
  ^
from sourcing file ~/.iterm2_shell_integration.fish
	called on line 7 of file ~/.config/fish/config.fish

from sourcing file ~/.config/fish/config.fish
	called during startup


       functions - print or erase functions

   Synopsis
       functions [ -a | --all ] [ -n | --names ]
       functions [ -D | --details ] [ -v ] FUNCTION
       functions -c OLDNAME NEWNAME
       functions -d DESCRIPTION FUNCTION
       functions [ -e | -q ] FUNCTIONS...

functions: Type 'help functions' for related documentation

fish: Unknown command 'iterm2_fish_mode_prompt'
~/.iterm2_shell_integration.fish (line 69):
     iterm2_fish_mode_prompt
     ^
in function 'fish_mode_prompt'
	called on standard input

in command substitution
	called on standard input

~
❯
❯ echo $pure_version
1.13.0
fish: Unknown command 'iterm2_fish_mode_prompt'
~/.iterm2_shell_integration.fish (line 69):
     iterm2_fish_mode_prompt
     ^
in function 'fish_mode_prompt'
	called on standard input

in command substitution
	called on standard input


~
❯

my config.fish:

test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish
@andreiborisov
Copy link
Collaborator

andreiborisov commented Jan 9, 2019

We just need to define dummy fish_mode_prompt function or remove this empty file altogether. Although I recall that iTerm marker will be misplaced. Perhaps, we should consider to add custom support for it to align it properly.

@JunJi-JiaYue while I'm looking into it, you can remove fish_mode_prompt.fish from functions folder to fix it locally if you don’t want to wait for a patch.

@edouard-lopez
Copy link
Member

@schrodincat By misplaced, do you mean it's an installer issue? If so, it needs to be reported to fisher while we fix our installer.

@edouard-lopez edouard-lopez added 🐛 bug something that doesn't works as expected ❓discussion understanding the project and its choices labels Jan 9, 2019
@andreiborisov
Copy link
Collaborator

By misplaced, do you mean it's an installer issue?

No, what I mean it doesn't align properly:
screenshot 2019-01-09 at 17 54 02

@edouard-lopez
Copy link
Member

@schrodincat I won't be able to help here, I'm on Linux

@edouard-lopez edouard-lopez added this to the 2.x milestone Jan 12, 2019
@rafaelrinaldi
Copy link
Collaborator

@JunJi-JiaYue How have you installed pure? Through OMF? I think I have seen this before.

@JunJi-JiaYue
Copy link
Author

I have installed it through fisher.

@sanyer
Copy link

sanyer commented Apr 3, 2019

@edouard-lopez was this fixed? I still see that error message.

@edouard-lopez
Copy link
Member

My bad, thought that @JunJi-JiaYue last message meant it was fixed

@edouard-lopez edouard-lopez reopened this Apr 3, 2019
@edouard-lopez
Copy link
Member

@JunJi-JiaYue @sanyer could you clarify your bug behavior?

'fish_mode_prompt' does not exist

If the issue is functions: Function 'fish_mode_prompt' does not exist then create a file with this name in your home directory:

echo '' > $HOME/.config/fish/functions/fish_mode_prompt.fish

Auto-loading function

If you want to leverage auto-loading mechanism, .iterm2_shell_integration.fish should be in ~/.config/fish/functions or one of the directory set in or $fish_function_path

Fish issue?

You might look at fish issues. For instance, this one fish-shell/fish-shell#2692 (comment) has a snippet defining iterm2_fish_mode_prompt based on fish_mode_prompt.

Sorry I can't help more as it's MacOS-related issue.

@sanyer
Copy link

sanyer commented Apr 4, 2019

@edouard-lopez actually, removing the file fish_mode_prompt.fish helps

@JunJi-JiaYue
Copy link
Author

Sorry for my late reply.
Defining empty fish_mode_prompt function in my config.fish helps.

@sanyer
Copy link

sanyer commented Apr 9, 2019

Seems more like a workaround. Maybe at least write about this in README.md?

@edouard-lopez
Copy link
Member

From what you described, it's a fish-related configuration issue.
I'm in favour to keep the readme concise, as we have issue tracker for this kind of corner case.
Probably a good idea will be to submit a PR to update fish documentation.

@andreiborisov
Copy link
Collaborator

andreiborisov commented Apr 10, 2019

@sanyer that’s not fish issue, but rather iTerm integration script issue. I’ll tackle this in future releases, for now, please use proposed workaround.

@edouard-lopez what is the purpose of fish_mode_prompt function for us anyway? Do we need empty fish_mode_prompt.fish without function definition? Is this even correct to leave empty file without actual function definition? Maybe we should at least declare empty fish_mode_prompt function there? That would at least resolve current issue.

@edouard-lopez
Copy link
Member

@schrodincat we don't use fish_mode_prompt that's why I said it's not a pure issue (as one originating from our code).
We could add an empty function as it's a low cost addition

@sanyer
Copy link

sanyer commented Apr 11, 2019

yeah, so other themes I used had fish_mode_prompt.fish with empty fish_mode_prompt function

@sanyer
Copy link

sanyer commented Apr 12, 2019

cool, thanks @schrodincat and @edouard-lopez 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something that doesn't works as expected ❓discussion understanding the project and its choices
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants