Giter VIP home page Giter VIP logo

Comments (6)

Foxboron avatar Foxboron commented on August 14, 2024

This is an inherent issue with how I have implemented the terminal colors. All commands are closed off with that escape code for no good reason.

https://github.com/Foxboron/sbctl/blob/master/cmd/sbctl/main.go#L352

I should try and implement the new command structure with the cli output to fix this :/ Is it completely broken with fish? zsh works fine with the escape at the bottom.

from sbctl.

igo95862 avatar igo95862 commented on August 14, 2024

Is it completely broken with fish?

Yes. Fish is strict about script formatting.

from sbctl.

igo95862 avatar igo95862 commented on August 14, 2024

BTW. Why not write to some file directly instead of stdout? Probably avoids the issue but require slight PKGBUILD modification.

from sbctl.

Foxboron avatar Foxboron commented on August 14, 2024

I think generally restructuring the AddCommand section to add PostRun with the off switch on everything except the completion stuff is the way to go.

from sbctl.

igo95862 avatar igo95862 commented on August 14, 2024

I think it is also possible to send control sequences in to stderr instead of stdout. Usually but will be linked to same pipe as stdout but in case of shell redirect > only stdout will be redirected.

from sbctl.

igo95862 avatar igo95862 commented on August 14, 2024

Ok. I tested changing fmt.Print(off) to fmt.Fprint(os.Stderr, off) and it works. Shell scripts are no longer corrupted and colors are still displayed. This is a one line change.

from sbctl.

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.