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

Can't use chezmoi edit with helix editor on macos #3971

Closed
suspenss opened this issue Oct 4, 2024 · 2 comments
Closed

Can't use chezmoi edit with helix editor on macos #3971

suspenss opened this issue Oct 4, 2024 · 2 comments
Labels
in dependency In a dependency, not in chezmoi

Comments

@suspenss
Copy link

suspenss commented Oct 4, 2024

Describe the bug

When running chezmoi edit $filename with helix editor in mac os, chezmoi can't receive the change of the file. In my machine, vim, nano, nvim work correctly.

To reproduce

When setting the $EDITOR to hx or helix, chezmoi edit will call the helix editor to edit the target file, After write the file, I save and quit helix, but chezmoi can't receive the newer change, chezmoi diff have no output.

Expected behavior

chezmoi diff can show the change of file and chezmoi apply can apply the change to the source file.

Output of command with the --verbose flag

--verbose don't have details output, When I using chezmoi edit $filename debug, these outputs tell me chezmoi receive nothing from editor.

The out put is as follow:

epoche at ~ % chezmoi edit .zshrc --debug
time=2024-10-04T19:08:03.224+08:00 level=INFO msg=persistentPreRunRootE version.version=2.52.3 version.commit=Homebrew version.date=2024-09-30T08:39:47Z version.builtBy=Homebrew args="[chezmoi edit .zshrc --debug]" goVersion=go1.23.1
time=2024-10-04T19:08:03.224+08:00 level=INFO msg=Stat component=system name=/Users/epoche/.config/chezmoi/chezmoistate.boltdb
time=2024-10-04T19:08:03.224+08:00 level=INFO msg=Stat component=system name=/Users/epoche/.local/share/chezmoi
time=2024-10-04T19:08:03.224+08:00 level=INFO msg=Stat component=system name=/Users/epoche/.local/share/chezmoi/.git
time=2024-10-04T19:08:03.225+08:00 level=INFO msg=chezmoi.OSRelease err="file does not exist"
time=2024-10-04T19:08:03.225+08:00 level=ERROR msg=ReadFile component=system err="open /Users/epoche/.local/share/chezmoi/.chezmoiroot: no such file or directory" name=/Users/epoche/.local/share/chezmoi/.chezmoiroot size=0 data=""
time=2024-10-04T19:08:03.225+08:00 level=ERROR msg=ReadFile component=system err="open /Users/epoche/.local/share/chezmoi/.chezmoiversion: no such file or directory" name=/Users/epoche/.local/share/chezmoi/.chezmoiversion size=0 data=""
time=2024-10-04T19:08:03.225+08:00 level=INFO msg=Stat component=system name=/Users/epoche/.local/share/chezmoi
time=2024-10-04T19:08:03.225+08:00 level=INFO msg=Stat component=system name=/Users/epoche/.local/share/chezmoi
time=2024-10-04T19:08:03.225+08:00 level=INFO msg=ReadDir component=system name=/Users/epoche/.local/share/chezmoi
time=2024-10-04T19:08:03.226+08:00 level=INFO msg=MkdirTemp tempDir=/var/folders/nd/x5c9p69s6f9fgqslbdz6m0nh0000gn/T/chezmoi-edit610000096
time=2024-10-04T19:08:03.226+08:00 level=INFO msg=Link component=system oldPath=/Users/epoche/.local/share/chezmoi/dot_zshrc newPath=/var/folders/nd/x5c9p69s6f9fgqslbdz6m0nh0000gn/T/chezmoi-edit610000096/.zshrc
time=2024-10-04T19:08:03.226+08:00 level=INFO msg=Close component=persistentState
time=2024-10-04T19:08:17.837+08:00 level=INFO msg=Run cmd="/usr/local/bin/hx /var/folders/nd/x5c9p69s6f9fgqslbdz6m0nh0000gn/T/chezmoi-edit610000096/.zshrc" duration=14.610816115s err=<nil>
time=2024-10-04T19:08:17.837+08:00 level=INFO msg=Close component=persistentState
time=2024-10-04T19:08:17.837+08:00 level=INFO msg=RemoveAll tempDir=/var/folders/nd/x5c9p69s6f9fgqslbdz6m0nh0000gn/T/chezmoi-edit610000096
                                                                                                                                                                          
epoche at ~ % 

Output of chezmoi doctor

epoche at ~ % chezmoi doctor             
RESULT   CHECK                       MESSAGE
ok       version                     v2.52.3, commit Homebrew, built at 2024-09-30T08:39:47Z, built by Homebrew
ok       latest-version              v2.52.3
ok       os-arch                     darwin/amd64
ok       uname                       Darwin bogon 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:44 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_X86_64 x86_64
ok       go-version                  go1.23.1 (gc)
ok       executable                  /usr/local/bin/chezmoi
ok       upgrade-method              replace-executable
ok       config-file                 no config file found
ok       source-dir                  ~/.local/share/chezmoi is a git working tree (clean)
ok       suspicious-entries          no suspicious entries
ok       working-tree                ~/.local/share/chezmoi is a git working tree (clean)
ok       dest-dir                    ~ is a directory
ok       umask                       022
ok       cd-command                  found /bin/zsh
ok       cd-args                     /bin/zsh
info     diff-command                not set
ok       edit-command                found /usr/local/bin/hx
ok       edit-args                   /usr/local/bin/hx
ok       git-command                 found /usr/local/bin/git, version 2.46.2
ok       merge-command               found /usr/bin/vimdiff
ok       shell-command               found /bin/zsh
ok       shell-args                  /bin/zsh
info     age-command                 age not found in $PATH
ok       gpg-command                 found /usr/local/bin/gpg, version 2.4.5
info     pinentry-command            not set
info     1password-command           op not found in $PATH
info     bitwarden-command           bw not found in $PATH
info     bitwarden-secrets-command   bws not found in $PATH
info     dashlane-command            dcli not found in $PATH
info     doppler-command             doppler not found in $PATH
info     gopass-command              gopass not found in $PATH
info     keepassxc-command           keepassxc-cli not found in $PATH
info     keepassxc-db                not set
info     keeper-command              keeper not found in $PATH
info     lastpass-command            lpass not found in $PATH
info     pass-command                pass not found in $PATH
info     passhole-command            ph not found in $PATH
info     rbw-command                 rbw not found in $PATH
info     vault-command               vault not found in $PATH
info     vlt-command                 vlt not found in $PATH
info     secret-command              not set
                                                                                                                                                                          
epoche at ~ % 

Additional context

Nothing.

@twpayne twpayne added the in dependency In a dependency, not in chezmoi label Oct 4, 2024
@twpayne
Copy link
Owner

twpayne commented Oct 4, 2024

This is a bug in Helix. Current versions of Helix are not able to edit files which are hardlinks.

See helix-editor/helix#11279 for the bug and helix-editor/helix#11340 for the fix.

The short-term work-around is to put to set edit.hardlink to false in your chezmoi configuration file.

@suspenss
Copy link
Author

suspenss commented Oct 4, 2024

Thank u, very helpful!

@twpayne twpayne closed this as completed Oct 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in dependency In a dependency, not in chezmoi
Projects
None yet
Development

No branches or pull requests

2 participants