You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Word boundaries for Alt-B, Alt-F, Ctrl-W, Alt-Left, Alt-Right... changed with 3.4.0 update #8790
Since updating to fish version 3.4.0 the behaviour of Alt-B, Alt-F, and Cmd-W has changed. For example
$ asdf_adsf # pressing Cmd-W used to delete _asdf, now deletes asdf_asdf
I can't find documentation for this change and would like to be able to revert back to the old behaviour. This seems related to the discussion in issue #384
I see why the change to Ctrl-W is sensible, but why change all other movement keys as well? This behaviour should depend on emacs or vi mode. The new behaviour is not consistent with either mode.
@faho A lot of thought went into the previous behaviour and it was consistent as can be seen from #384. This change throws out all the old considerations, introduces inconsistencies and in compatabilities.
Could you at least consider making this configurable?
Since updating to fish version 3.4.0 the behaviour of Alt-B, Alt-F, and Cmd-W has changed.
$ asdf_adsf # pressing Cmd-W used to delete _asdf, now deletes asdf_asdf
Same thing happened on 3.3.1.
I think the behavior you want is bind \cw backward-kill-word
Your observed behavior change might stem from e50d104 (Remove duplicate \cw binding in default key bindings, 2015-11-08).
That commit removed the backward-kill-word C-w binding; now only backward-kill-path-component remains.
I don't think Alt-B or Alt-F have changed much (ever)?
Regarding configurability: maybe it's worth adding commands like forward-regex (C-s), backward-kill-regex etc.
They can be used to implement many possible motions.
When used without a regex argument, they can prompt for one interactively. I think that'd be nice to navigate long commandlines. Today I just use my editor via A-e, that's good enough too.
I'm sorry, I am confused about what is the expected behavior now and I can't find any mention of this change in the release notes.
From experience I can say I've been driven up the wall these past two days as it seems Alt stopped working for me in the most basic scenario like this:
I type cd
Fish suggests completion based on history like Documents/Computer/Configuration/ (displays it in muted color in front of my cursor)
I press Alt+Right Arrow
What used to happen is that it would complete the first path component and leave the other two as suggestion.
Now it just completes the whole path – just as if I pressed Right Arrow alone without holding Alt key. I can't choose a different directory in Documents/ unless I manually type in the whole directory name.
What am I missing? What else am I supposed to use instead of Alt+Right Arrow?
I use Terminal.app on macOS and I don't believe I've changed any mapping from the default. Attached screenshot of "Keyboard" section from profile preferences.
fish_key_reader
Press a key:
bind \ef 'do something'
Unfortunately that did not help. For what it's worth I've never played with that Meta key option before and Alt+Right seemed to work. What changed in 3.4?
Setting bind --preset \ef forward-word did make Alt+Right as well as Alt+f do the right thing for me. Should I add that to my personal config or will it work out of the box after the patch?
Thank you for quick support and your work on the project!
Me being "driven up the wall" by this for the last two days is just an indication of how important Fish has been in my life in the last 6+ years I've been using it. It's part of my brain now.
Sorry to comment on the closed issue, but I'm encountering an issue with fish_3.4.1 on using alt-right or alt-left:
fish: Unknown command: nextd-or-forward-word
@rajashekar007
You're not running fish 3.4.1. That's an old fish left over. Either you just need to restart fish (to get the new version), or you have an old binary lying around that's started instead of the real thing.
Edit : I wasn't on 3.7.1, obviously fish --version gives the installed version, not necessarily the one running. Everything's smooth now
@faho I have the same issue on 3.7.1. Also, I was running 3.3.1 sooner this morning which I installed not six months ago. But that's just me not reading the manual and taking whatever version was on dnf without adding any repo.
Alt-B and Alt-F work fine, which really surprises me as I would have expected them to be binding for the same function.
On an other machine, everything works fine. The main difference is the good one is Ubuntu, the one with an error is Oracle linux server.
Don't bother with it though, I'll do a proper bug report after some further digging. I just had to comment that first § it was just too funny bringing up my frozen fish right after you scolded someone for months old leftovers.
Activity
faho commentedon Mar 15, 2022
We're reasonably happy with how these things work now and won't be changing them back.
E.g. ctrl-w is "backward-kill-path-component", it's supposed to remove one path component, and now it does.
Sorry if that's not to your liking.
bo0ts commentedon Mar 15, 2022
I see why the change to
Ctrl-Wis sensible, but why change all other movement keys as well? This behaviour should depend on emacs or vi mode. The new behaviour is not consistent with either mode.bo0ts commentedon Mar 15, 2022
@faho Unfortunately Alt-B and Ctrl-W now have a different notion of "word":
faho commentedon Mar 15, 2022
They do, because "ctrl-w" has no notion of a "word". It has a notion of a "path-component", it acts on path components.
bo0ts commentedon Mar 15, 2022
@faho A lot of thought went into the previous behaviour and it was consistent as can be seen from #384. This change throws out all the old considerations, introduces inconsistencies and in compatabilities.
Could you at least consider making this configurable?
faho commentedon Mar 15, 2022
And a lot of thought went into the current behavior, including complaints about the old being inconsistent.
We don't make things like this configurable.
I am afraid the answer is quite simply: No. I now consider this matter closed. Sorry!
krobelus commentedon Mar 15, 2022
Same thing happened on 3.3.1.
I think the behavior you want is
bind \cw backward-kill-wordYour observed behavior change might stem from e50d104 (Remove duplicate \cw binding in default key bindings, 2015-11-08).
That commit removed the
backward-kill-wordC-w binding; now onlybackward-kill-path-componentremains.I don't think Alt-B or Alt-F have changed much (ever)?
Regarding configurability: maybe it's worth adding commands like
forward-regex(C-s),backward-kill-regexetc.They can be used to implement many possible motions.
When used without a regex argument, they can prompt for one interactively. I think that'd be nice to navigate long commandlines. Today I just use my editor via A-e, that's good enough too.
bo0ts commentedon Mar 17, 2022
@krobelus Thank you for the helpful comment. @faho Turns out this is already perfectly customisable.
amw commentedon Mar 22, 2022
I'm sorry, I am confused about what is the expected behavior now and I can't find any mention of this change in the release notes.
From experience I can say I've been driven up the wall these past two days as it seems Alt stopped working for me in the most basic scenario like this:
cdDocuments/Computer/Configuration/(displays it in muted color in front of my cursor)What used to happen is that it would complete the first path component and leave the other two as suggestion.
Now it just completes the whole path – just as if I pressed Right Arrow alone without holding Alt key. I can't choose a different directory in
Documents/unless I manually type in the whole directory name.What am I missing? What else am I supposed to use instead of Alt+Right Arrow?
krobelus commentedon Mar 22, 2022
Yes, that's the expected behavior.
You have either remapped Alt+RightArrow, or your terminal sends a funny key sequence when you press that key
Here's how you can check what key sequence is sent, and its current binding (mine is the default)
amw commentedon Mar 22, 2022
I use
Terminal.appon macOS and I don't believe I've changed any mapping from the default. Attached screenshot of "Keyboard" section from profile preferences.faho commentedon Mar 22, 2022
@amw Your terminal sends alt+f instead of alt+right. This is indistinguishable to fish.
You want to check that "Use Option as Meta key" to unbreak it.
amw commentedon Mar 22, 2022
Unfortunately that did not help. For what it's worth I've never played with that Meta key option before and Alt+Right seemed to work. What changed in 3.4?
3 remaining items
Let nextd-or-forward-word binding move like normal forward_word
faho commentedon Mar 22, 2022
Okay, should be fixed.
I'm going to cherry-pick that one for 3.4.1, which should be released soon.
Let nextd-or-forward-word binding move like normal forward_word
amw commentedon Mar 22, 2022
Setting
bind --preset \ef forward-worddid make Alt+Right as well as Alt+f do the right thing for me. Should I add that to my personal config or will it work out of the box after the patch?krobelus commentedon Mar 22, 2022
nice, thanks for the report & fix. I guess our nightlies haven't been tested much with Terminal.app
yes
amw commentedon Mar 22, 2022
Thank you for quick support and your work on the project!
Me being "driven up the wall" by this for the last two days is just an indication of how important Fish has been in my life in the last 6+ years I've been using it. It's part of my brain now.
zanchey commentedon Mar 23, 2022
I use it but I guess I don't use Alt-F much
faho commentedon Mar 23, 2022
Note: The original request turned out to be a misunderstanding about what the ctrl-w binding does (this was changed in 2012, not recently).
What was fixed was a regression in alt-left/alt-right.
So we're playing a bit fast and loose with this issue. That probably can't be helped - opening a separate issue just for that won't help much.
rajashekar007 commentedon May 26, 2022
Sorry to comment on the closed issue, but I'm encountering an issue with fish_3.4.1 on using alt-right or alt-left:
fish: Unknown command: nextd-or-forward-word
Any help would be appreciated. Thanks.
faho commentedon May 26, 2022
@rajashekar007
You're not running fish 3.4.1. That's an old fish left over. Either you just need to restart fish (to get the new version), or you have an old binary lying around that's started instead of the real thing.
42xel commentedon Aug 2, 2024
Edit : I wasn't on 3.7.1, obviously fish --version gives the installed version, not necessarily the one running. Everything's smooth now
@faho I have the same issue on 3.7.1. Also, I was running 3.3.1 sooner this morning which I installed not six months ago. But that's just me not reading the manual and taking whatever version was on dnf without adding any repo.
Alt-B and Alt-F work fine, which really surprises me as I would have expected them to be binding for the same function.
On an other machine, everything works fine. The main difference is the good one is Ubuntu, the one with an error is Oracle linux server.
Don't bother with it though, I'll do a proper bug report after some further digging. I just had to comment that first § it was just too funny bringing up my frozen fish right after you scolded someone for months old leftovers.