Comments (10)
I've opened neovim/neovim#27499. As this is a bug in Neovim, I'll close this issue.
from chezmoi.
BTW @twpayne, I grabbed a pre-built nightly from here and cannot reproduce the bug with it. So it would appear that v0.10 should fix this.
Thanks again for taking the time to diagnose and report this upstream (even though it was closed as a duplicate).
from chezmoi.
I'm unable to reproduce this problem on macOS with nvim v0.9.5 and chezmoi v2.46.1. For me, the autocommand works as a expected and chezmoi applies the file on write and exits successfully.
Could you give steps to reproduce the problem in an isolated environment, e.g. a docker container?
Alternatively, if you add --debug
to the chezmoi apply
command, what do you see?
autocmd BufWritePost ~/.local/share/chezmoi/* ! chezmoi apply --debug --source-path "%"
from chezmoi.
I upgraded to 2.46.1, and am running neovim 0.9.5 as well. Still getting the error. This is on Ubuntu 20.04.
The debug logging disappears when nvim exits, so I can only get that logging when I write the buffer using :w
. Here's that debug output, but keep in mind that the bad exit status for chezmoi only happens when I run :wq
.
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/colors
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/ftdetect
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/ftplugin
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/syntax
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/private_dot_gnupg
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=system name=/home/erik/.local/share/chezmoi/private_dot_ssh
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadFile component=system name=/home/erik/.local/share/chezmoi/dot_vimrc size=3371 data="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..."
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=Lstat component=system n ame=/home/erik/.vimrc
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=Get component=persistentState bucket=entryState key=/home/erik/.vimrc value="{\n \"type\": \"file\",\n \"mode\": 420,\n \"contentsSHA256\": \"39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9\"\n}\n"
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadFile component=system name=/home/erik/.vimrc size=3371 data="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..."
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=defaultPreApplyFunc targetRelPath=.vimrc targetEntryState.Type=file targetEntryState.Mode=420 targetEntryState.ContentsSHA256=39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9 targetEntryState.contents="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..." lastWrittenEntryState.Type=file lastWrittenEntryState.Mode=420 lastWrittenEntryState.ContentsSHA256=39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9 actualEntryState.Type=file actualEntryState.Mode=420 actualEntryState.ContentsSHA256=39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9 actualEntryState.contents="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..."
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=Close component=persistentState
I can reproduce this on Arch Linux with the same versions of chezmoi and neovim.
from chezmoi.
Will have to wait until later to try to reproduce in Docker.
from chezmoi.
One weird detail: On Arch Linux, I forgot to add the chezmoi.toml, and I still see the same error. Also, files open in ~/.local/share/chezmoi
when chezmoi edit
is invoked. I'm not sure why it does that when I had to disable edit.hardlink
to get it to open the files there on Ubuntu.
from chezmoi.
Ah, I can now reproduce this. Interestingly, the autocmd works when you write the file from nvim (:w
) but I also get the chezmoi: exit status 134
error when you write and quit nvim (:wq
). So, I currently suspect some nvim weirdness.
from chezmoi.
Yeah, the autocmd works in both cases (:w
then :q
, or :wq
). The changes do get successfully applied as expected in both cases. But only :wq
causes chezmoi to exit nonzero.
from chezmoi.
So, it turns out that chezmoi is doing the right thing here. nvim is exiting with exit code 134, which is non-zero and therefore indicates failure. Exit code 134 typically means that the process received a SIGABRT. chezmoi is faithfully reporting nvim's self-reported failure. #3577 improves chezmoi's logging of all subprocesses it runs.
This is definitely a bug in NeoVim. I can reproduce it without involving chezmoi. I'll create an issue there.
from chezmoi.
Excellent, thanks so much for looking into it.
from chezmoi.
Related Issues (20)
- splitList and quoteList don't work in pair HOT 1
- chezmoi on Android can't connect to Internet/DNS HOT 4
- No "CHEZMOI_" env vars visible to plugins HOT 1
- Do not list empty directories and directories with only ignored files/subdirectories in `unmanaged` output HOT 1
- `chezmoi remove` removes the whole directory instead of removing a target HOT 3
- How to set an expiration time for "run_onchange_" script? HOT 10
- Automated push to chezmoi.io fails with permission denied error HOT 1
- GitHub Actions tests on macOS occasionally fail due to unexpected output from KeePassXC in open mode
- Provide `.chezmoi.script` context for templated scripts
- A way to set command aliases HOT 1
- get.chezmoi.io still returns old install script HOT 1
- chezmoi is not respecting my .chezmoiignore HOT 4
- git-commit-message don't understand copies detected by git
- Comments containing {{ and }} break .chezmoiignore on Windows HOT 2
- How to manage chezmoi config file with chezmoi itself? HOT 1
- Improve automatic dependency updates HOT 1
- Unable to add `~/.config/chezmoi/chezmoi.toml` to chezmoi HOT 12
- Adding local changes to target which is templated HOT 3
- Cannot auto commit/push scripts HOT 11
- promptChoice but allow for selecting multiple choices HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chezmoi.