2023-08-27 20:47:47 +02:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
shellIntegration = ''
|
2024-06-23 16:05:25 +02:00
|
|
|
function yy() {
|
2024-02-27 00:00:56 +01:00
|
|
|
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
2023-12-16 00:07:57 +01:00
|
|
|
yazi "$@" --cwd-file="$tmp"
|
2023-08-27 20:47:47 +02:00
|
|
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
2024-05-27 23:50:57 +02:00
|
|
|
builtin cd -- "$cwd"
|
2023-08-27 20:47:47 +02:00
|
|
|
fi
|
|
|
|
rm -f -- "$tmp"
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
programs.bash.enable = true;
|
|
|
|
|
|
|
|
programs.yazi = {
|
|
|
|
enable = true;
|
|
|
|
enableBashIntegration = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.yazi = { };
|
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
assertFileContains home-files/.bashrc '${shellIntegration}'
|
|
|
|
'';
|
|
|
|
}
|