Giter Site home page Giter Site logo

Comments (13)

fdncred avatar fdncred commented on June 7, 2024 1

This is the biggest annoyance while trying to integrate nu into neovim, IIRC there is a way to detect if ansi is supported in the context and automatically strip.

In rust, it's in the PR I mentioned. Seems like it's is_tty() or something like that.

from nushell.

fdncred avatar fdncred commented on June 7, 2024 1

Just to be clear for others reading this. This is what happens with -l and -c and -n.

This really needs to go in our documentation somewhere.

nu -c "ls"

  • Always read personal plugin.nu file if it exists
  • Always reads the default_env.nu file
  • Does not read any config.nu file
  • Does not read any login.nu file

nu -l -c "ls"

  • Always read personal plugin.nu file if it exists
  • Always reads personal env.nu file if it exists
  • Always reads personal config.nu if it exists
  • Always reads personal login.nu if it exists

nu -l -c "ls" --config foo_config.nu

  • Always reads personal plugin.nu file if it exists
  • Always reads personal env.nu file if it exists
  • Always reads specified config file foo_config.nu
  • Always reads personal login.nu if it exists

nu -l -c "ls" --config foo_config.nu --env-config foo_env.nu

  • Always read personal plugin.nu file if it exists
  • Always reads specified file foo_env.nu
  • Always reads specified file foo_config.nu
  • Always reads personal login.nu if it exists

nu -n -l -c "ls"

  • Does not load any plugin.nu file
  • Does not load any env.nu file
  • Does not load any config.nu file
  • Does not load any login.nu file

I just updated this 2024-01-18 nushell version 0.89.1 commit 55bf4d8

from nushell.

fdncred avatar fdncred commented on June 7, 2024

We have a PR that may help with this, but it's not landed yet. What about adding | ansi strip?

from nushell.

SFurnace avatar SFurnace commented on June 7, 2024

@fdncred

Thanks for the reply, but | ansi strip doesn't work in this case, as the command may have thrown an error during the checking phase before it was actually executed. Is there a link to the PR you are talking about? I'd like to subscribe.

from nushell.

fdncred avatar fdncred commented on June 7, 2024

You could also try setting this in your terminal or config.nu file. $env.config.use_ansi_coloring = false.

PR #11494 - Feel free to test this out and let us know if it works.

from nushell.

melMass avatar melMass commented on June 7, 2024

This is the biggest annoyance while trying to integrate nu into neovim, IIRC there is a way to detect if ansi is supported in the context and automatically strip.

from nushell.

SFurnace avatar SFurnace commented on June 7, 2024

@fdncred

I tried to build nu with PR #11494, and set $env.config.ansi_coloring to auto, but it doesn't work.
image

After some attempts, I realized that it seems like nu -c will ignore the default config file:
image

If I use nu --config /path/to/config/file to specify config file, it can work correctly with "Edit with Shell Command" plugin:
image

from nushell.

fdncred avatar fdncred commented on June 7, 2024

Thanks @SFurnace for trying it out. It could be many things that are causing it. If we're lucky, the author of that PR will have time to investigate.

from nushell.

nibon7 avatar nibon7 commented on June 7, 2024

Similar to #11494 (comment), if you are using https://marketplace.visualstudio.com/items?itemName=ryu1kn.edit-with-shell, I suggest you set editWithShell.shellArgs.linux=["-c", "-l"] or editWithShell.shellArgs.osx=["-c", "-l"]
@SFurnace

from nushell.

fdncred avatar fdncred commented on June 7, 2024

Good point @nibon7. Thanks!

from nushell.

SFurnace avatar SFurnace commented on June 7, 2024

@nibon7
I tried adding the -l parameter to nu and it did work!

from nushell.

melMass avatar melMass commented on June 7, 2024

Damn 😅 !
This should probably be somewhere more discoverable

from nushell.

fdncred avatar fdncred commented on June 7, 2024

Damn 😅 ! This should probably be somewhere more discoverable

Feel free to find a place in our docs for it. I just haven't got around to it.
image

from nushell.

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.