broot: Alt-Enter does not work on Windows
alt-enter is the Windows Console / Terminal shortcut to maximize/restore the console/terminal window. Therefore, it is not possible to execute :open_leave or :cd with this shortcut. Changing the shortcut works for :open_leave only. When trying to set
{
key: shift-enter
execution: ":cd"
}
you get Bad configuration: not a known internal: cd
this stand in the way of a br function in powershell, where you can change dir with a shortcut:
function br() {
$tmp = [System.IO.Path]::GetTempFileName()
c:\OwnApp\Tools\broot.exe --outcmd "$tmp" $args
$cd = Get-Content "$tmp"
Remove-Item -Force "$tmp"
$dir = $cd.substring(3)
if (Test-Path -PathType Container "$dir") {
if ("$dir" -ne "$pwd") {
Push-Location "$dir"
}
}
}
(selecting the path and then :cd is working, but a shortcut would be nice)
This problem occurs with broot running locally on Windows, but also with broot running on a remote host, when connected over ssh in the Windows Console / Terminal
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 15 (4 by maintainers)
Commits related to this issue
- add "ol" shortcut on open_leave for dirs for consistency See https://github.com/Canop/broot/issues/588#issuecomment-1304155283 — committed to Canop/broot by Canop 2 years ago
Also, for those of us using git-bash on Windows.
Would it be possible to fix/escape the path that’s being returned when invoking
:cd?So hitting
enterdoes not result in an error message, like:bash: cd: C:Windowssystem32: No such file or directory@Canop it’s what this issue was opened with (regardless of the shortcut key):
results in
edit: found this related issue and added a comment there: https://github.com/Canop/broot/issues/365
Thanks much to both of you!
@AeliusSaionji Your code fixed the slashes issue just fine. But it also generated:
& the error:
bash: cd: cd C:/Windows/system32: No such file or directory@Canop That would be great if you do the replacement in Broot itself.
Also, could the source statement that
broot --installwrites to.bashrcand.bash_profilebe modified to use forward slashes?i.e.:
source C:/Users/Windows/AppData/Roaming/dystroy/broot/data/launcher/bash/1