fish-shell
Repos
3

Events

Created at 3 hours ago
pull request opened
completion/usbip: use string-match to detect remote

Description

Forget to remove this detection, just match ip:port to use as remote.

Fixes issue #

TODOs:

  • [ ] Changes to fish usage are reflected in user documentation/manpages.
  • [ ] Tests have been added for regressions fixed
  • [ ] User-visible changes noted in CHANGELOG.rst
Created at 4 hours ago
pull request opened
Exclude current directory ('.') from rsync completions

Description

This is what currently happens when I try to tab complete on a directory with a single file (file.txt) in the middle of an rsync command:

$ rsync localhost:~/stuff/<TAB>
…:~/stuff/./  (Remote path)  …:~/stuff/file.txt  (Remote path)

The current directory (.) shows up as an option and stops rsync from automatically selecting the only file. I can't think of a reason why one would actually want to tab complete to . (and even if one did, just typing . is a hell of a lot quicker than waiting for a response that probably traverses the network). I couldn't find any rsync option to exclude the current directory so I just used string match to remove it. Hopefully nothing actually useful gets matched (I tried, for example, creating file. and directory./ and they still show up) but I would appreciate it if someone could double-check.

TODOs:

  • [ ] Changes to fish usage are reflected in user documentation/manpages.
  • [ ] Tests have been added for regressions fixed
  • [ ] User-visible changes noted in CHANGELOG.rst
Created at 5 hours ago
pull request opened
Completions: sort git branches by recency

I have about fifty git branches for fish and I almost always git checkout between the most recent two or three. Maybe I'm not the only one.

Created at 7 hours ago

Suggest arguments for recently added git rebase --onto

It takes a wide variety of values, but I think branches are probably the most common payloads. We can also include recent commits?

Created at 7 hours ago

completion: add git rebase --onto (#9244)

Signed-off-by: Next Alone 12210746+NextAlone@users.noreply.github.com

Created at 8 hours ago
pull request closed
completion/git rebase
  • completion: add git rebase --onto

Description

Talk about your changes here.

Fixes issue #

TODOs:

  • [ ] Changes to fish usage are reflected in user documentation/manpages.
  • [ ] Tests have been added for regressions fixed
  • [ ] User-visible changes noted in CHANGELOG.rst
Created at 8 hours ago
pull request opened
Make \x the same as \X

Description

Up to now, in normal locales \x was essentially the same as \X, except that it errored if given a value > 0x7f.

That's kind of annoying and useless.

A subtle change is that \xHH now represents the character (if any) encoded by the byte value "HH", so even for values <= 0x7f if that's not the same as the ASCII value we would diverge.

I do not believe anyone has ever run fish on a system where that distinction matters. It isn't a thing for UTF-8, it isn't a thing for ASCII, it isn't a thing for UTF-16, it isn't a thing for any extended ASCII scheme - ISO8859-X, it isn't a thing for SHIFT-JIS.

I am reasonably certain we are making that same assumption in other places.

Fixes https://github.com/fish-shell/fish-shell/issues/1352

TODOs:

  • [ ] Changes to fish usage are reflected in user documentation/manpages.
  • [ ] Tests have been added for regressions fixed
  • [ ] User-visible changes noted in CHANGELOG.rst

This branch builds on #9245, because otherwise we would encode every \xAB with the ENCODE_DIRECT scheme, which would, among other things, break universal variables.

Created at 11 hours ago
issue comment
`cd` after `mkdir` or `git clone` should autosuggest the directory you just created.

I think there's an opportunity to be very clever here - perhaps even enough to show a ghost suggestion here. If we store a snapshot of the directory state (depth = 0) prior to invocation of an external command and then, once control has returned to the shell, discover that there is exactly one new entry or file, we can offer that up as a completion to the next command entered by the user.

I had for some time been thinking (or not even thinking, just subconsciously what-if'ing in the back of my mind) about what a really clever shell that injected itself (tee-like) at the end of every toolchain could learn from the stdout output of commands the user ran, and what it could suggest based off of them. This wasn't a serious train of thought, so no one go criticizing, but I was thinking along the lines of what kind of intelligent completions would we be able to offer that wasn't previously possible by pattern matching output to paths. All that to say, I think that fish has only scratched the surface when it comes to intuitive and intelligent suggestions and we should be pushing the box (carefully!) to try and challenge ourselves in new ways.

Created at 12 hours ago
Created at 12 hours ago
issue comment
git --work-tree=$HOME hangs on autocomplete

I looked at the duplicate and made my ~/.gitconfig to ignore non-dotfiles:

*
!.*

So it will only autocomplete ~/.* files

Created at 13 hours ago
closed issue
git --work-tree=$HOME hangs on autocomplete
3.5.1

Darwin MattBookAir.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:07 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8110 arm64
xterm-256color

I have an alias for handling my dotfiles

alias config 'git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

which is used like

config add ~/.config/fish/custom/my_function.fish
config commit -m "added my_function function"
config push

from any working directory and it works.

To avoid config showing ALL of my home when I do config status, I also did

config config --local status.showUntrackedFiles no

So... when I am wanting to add a new file to my config repo:

config add ~/.config/fish/custom/<TAB>

it get's stuck forever, instead of giving me options or at least giving me back control of the prompt.

asciinema recording


I just checked and the same happens with git --git-dir=$HOME/.cfg/ --work-tree=$HOME directly, and the problem seems to be --work-tree=$HOME. Any ideas?

Created at 13 hours ago
issue comment
git --work-tree=$HOME hangs on autocomplete

Duplicate of #8207

You're asking git to scan gigabytes of data. That's slow, because it's a big task.

No, I do not believe there is anything we can do here.

Created at 13 hours ago
opened issue
git --work-tree=$HOME hangs on autocomplete
3.5.1

Darwin MattBookAir.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:07 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8110 arm64
xterm-256color

I have an alias for handling my dotfiles

alias config 'git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

which is used like

config add ~/.config/fish/custom/my_function.fish
config commit -m "added my_function function"
config push

from any working directory and it works.

To avoid config showing ALL of my home when I do config status, I also did

config config --local status.showUntrackedFiles no

So... when I am wanting to add a new file to my config repo:

config add ~/.config/fish/custom/<TAB>

it get's stuck forever, instead of giving me options or at least giving me back control of the prompt.

asciinema recording


I just checked and the same happens with git --git-dir=$HOME/.cfg/ --work-tree=$HOME directly, and the problem seems to be --work-tree=$HOME. Any ideas?

Created at 14 hours ago

highlight: Unicode above 0x10FFFF is an error

This should really just be using read_unquoted_escape, where this was changed in #1107

Created at 14 hours ago
pull request opened
Decode multibyte escapes immediately

We forgot to decode (i.e. turn into nice wchar_t codepoints) "byte_literal" escape sequences. This meant that e.g.

string match ö \Xc3\Xb6

math 5 \X2b 5

didn't work, but math 5 \x2b 5 did, and would print the wonderful error:

math: Error: Missing operator
'5 + 5'
   ^

So, instead, we decode eagerly.

TODOs:

  • [N/A] Changes to fish usage are reflected in user documentation/manpages.
  • [X] Tests have been added for regressions fixed
  • [ ] User-visible changes noted in CHANGELOG.rst

Sidenote: The diff is an absolute mess - what I did was:

  1. Pack the switch/case into a while loop so we can continue
  2. Add a std::string buffer for multiple \X escaped values
  3. Move an early if (errored) return none() into the loop
  4. Make the path for "byte_literal" (currently that's only \X) put the value into the buffer and continue if there's another \X following.

A reasonably simple change, but because of the additional indentation this touched most of read_unquoted_escape. Sorry about that!

Created at 14 hours ago
issue comment
Consider extending \x to support non-ASCII characters

sounds good, thanks. Both \xe4 and \Xe4 should produce that byte. For Unicode characters we already have \u00e4

Created at 1 day ago
issue comment
completion/git rebase

Reduce write() calls for explicitly separated buffers

?

Oh, I don't know why it appeared here, maybe it was copied accidentally.

Created at 1 day ago