Git Product home page Git Product logo

Comments (3)

netei avatar netei commented on September 6, 2024

I've set

alias yank='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed "s/\x0f//g" | yank'

which solves the problem, kind of , but the output is not colored anymore

from yank.

mptre avatar mptre commented on September 6, 2024

Thanks for the report. However commands that is part of a chain of pipes
usually don't output ANSI escape sequence colors unless you explicitly
tell them to. Like the grep(1) --color=always option. If you still
want colors in the input sent to yank you could simply strip the yanked
field after. Notice yank command won't be invoked since the output is
piped, therefore the last call to xsel(1) is needed which of course
could be any command of your choice.

alias yank='yank | sed -r "s/\x1B[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed "s/\x0f//g" | xsel'

On Tue, Feb 23, 2016 at 08:26:48AM -0800, netei wrote:

I've set

alias yank='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed "s/\x0f//g" | yank'

which solves the problem, kind of , but the output is not colored anymore


Reply to this email directly or view it on GitHub:
#26 (comment)

:wq

from yank.

netei avatar netei commented on September 6, 2024

I have some custom commands that always output colors, that's why I needed this.

Your trick to put the pipes after the yank is great, I didn't know that yank would output to stdout when it is piped.

from yank.

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.