Giter Site home page Giter Site logo

Comments (6)

zanchey avatar zanchey commented on June 16, 2024

Can you show the flatpak version? Maybe flatpak --version?

from fish-shell.

zanchey avatar zanchey commented on June 16, 2024

flatpak ship a completion script upstream, maybe we should just remove the one with fish

https://github.com/flatpak/flatpak/blob/main/completion/flatpak.fish

from fish-shell.

mqudsi avatar mqudsi commented on June 16, 2024

Theirs doesn't provide descriptions for a lot of stuff. For some reason ours doesn't currently use flatpak remote-ls but it's very fast and a good candidate to use for completing flatpak install fo<TAB> , which upstream completions don't provide, either.


I think I found the issue, but it's weird. flatpak list --columns=application,name is detecting a tty when we are capturing the output in a "subshell".

What we expect, simulated by piping to cat:

> flatpak list --app --columns=application,name | cat
org.kde.okular  KDE

That's the id, a \t, then the name, which might contain spaces:

┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 6f 72 67 2e 6b 64 65 2e ┊ 6f 6b 75 6c 61 72 09 4b │org.kde.┊okular_K│
│00000010│ 44 45 0a                ┊                         │DE_     ┊        │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘

What we get, which is the same as when flatpak thinks it is piping to a tty:

flatpak list --app --columns=application,name
Application ID      Name
org.kde.okular      KDE

which is pretty-formatted, includes the header row, and has multiple spaces (not one \t) for alignment:

> socat - EXEC:'flatpak list --app --columns=application\,name',pty,setsid,ctty | hexyl
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 1b 5b 31 6d 41 70 70 6c ┊ 69 63 61 74 69 6f 6e 20 │•[1mAppl┊ication │
│00000010│ 49 44 20 20 20 20 20 20 ┊ 4e 61 6d 65 1b 5b 32 32 │ID      ┊Name•[22│
│00000020│ 6d 0d 0a 6f 72 67 2e 6b ┊ 64 65 2e 6f 6b 75 6c 61 │m__org.k┊de.okula│
│00000030│ 72 20 20 20 20 20 20 4b ┊ 44 45 0d 0a             │r      K┊DE__    │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘

I can't reproduce this under master; did we have a fish bug where "subshell" executions would pass an isatty(3) check?


EDIT: I missed the obvious possibility, flatpak list checking isatty(3) is new behavior and OP is on an older version that never did that.

from fish-shell.

pixlxip avatar pixlxip commented on June 16, 2024

Upgrading to Flatpak 1.14.8 did not fix the problem.

from fish-shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.