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

Not compatible with fish shell #2

Open
7doi opened this issue Apr 25, 2020 · 3 comments
Open

Not compatible with fish shell #2

7doi opened this issue Apr 25, 2020 · 3 comments

Comments

@7doi
Copy link

7doi commented Apr 25, 2020

~# sh -c "$(curl -fsSL https://raw.githubusercontent.com/codinn/core-shell-scripts/master/install.sh)" && . "$HOME/.shrc_Core_Shell"
Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
fish: sh -c "$(curl -fsSL https://raw.githubusercontent.com/codinn/core-shell-scripts/master/install.sh)" && . "$HOME/.shrc_Core_Shell"
                                                                                                           ^
@7doi
Copy link
Author

7doi commented Apr 25, 2020

Also incompatible with windows openssh server:

Microsoft Windows [版本 10.0.18363.592]       
(c) 2019 Microsoft Corporation。保留所有权利。

xxx@XXX C:\Users\xxx> sh -c "$(curl -fsSL https://raw.githubusercontent.com/codinn/core-shell-scripts/master/install.sh)" && . "$HOME/.shrc_Core_Shell"
'sh' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

@yangyubo
Copy link
Member

yangyubo commented Apr 26, 2020

The integration script is missing fish and Windows command support, inspiration and/or pull request are welcome.

@dangh
Copy link

dangh commented Apr 28, 2021

you can put this function in ~/.config/fish/conf.d/update_coreshell_cwd.fish

function update_coreshell_cwd --argument-names cwd --on-event fish_prompt
    # Identify the directory using a "file:" scheme URL, including
    # the host name to disambiguate local vs. remote paths.

    # Percent-encode the pathname.
    test -n "$cwd" || set --local cwd (pwd)
    set --local url_path (string escape --style=url -- $cwd)

    if test -n "$TMUX"
    	printf '\ePtmux;\e\e]7;%s\a\e\\' "file://""$HOSTNAME""$url_path"
    else
        printf '\e]7;%s\a' "file://""$HOSTNAME""$url_path"
    end
end

if test -n "$TMUX"
    set --local fish (which fish)
    tmux set-hook -g window-pane-changed 'run-shell "'$fish' -c \'update_coreshell_cwd \'#{pane_current_path}\'\'"'
end

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

No branches or pull requests

3 participants