Comments (13)
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.
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.
We have a PR that may help with this, but it's not landed yet. What about adding | ansi strip
?
from nushell.
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.
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.
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.
I tried to build nu with PR #11494, and set $env.config.ansi_coloring
to auto
, but it doesn't work.
After some attempts, I realized that it seems like nu -c
will ignore the default config file:
If I use nu --config /path/to/config/file
to specify config file, it can work correctly with "Edit with Shell Command" plugin:
from nushell.
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.
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.
Good point @nibon7. Thanks!
from nushell.
@nibon7
I tried adding the -l
parameter to nu
and it did work!
from nushell.
Damn 😅 !
This should probably be somewhere more discoverable
from nushell.
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.
from nushell.
Related Issues (20)
- 0.90.1 regression: alt+d throws an error message HOT 15
- run-external is expanding globs (but shouldn't on Windows) with no way to opt out HOT 1
- Redirection: `e>|` and `e>` doesn't work properly if external command runs failed
- Ability to set HOME directory on windows (aka ~) HOT 1
- Autocompletion does not correctly handle Unicode characters.
- Auto-source config files in `$nu.default-config-dir/conf.d` and modules from `$nu.default-config-dir/modules.d` HOT 11
- nushell interprets any word containing 'date' in the command wrongly and provide date usage as output HOT 2
- Panic when completing with `..`
- Parsing a `register` command at the prompt can execute arbitrary files
- Python example is broken HOT 8
- In `http get` utility, headers are not working as expected HOT 5
- panic when too many arguments to custom command?
- $env.FILE_PWD is not available in constexpr context HOT 3
- flag on `uniq` command to maintain order HOT 1
- Inconsistent external program execution HOT 3
- Environment change does not persist when calling function from another NU file HOT 4
- `input` with initial value provided, like bash `read -i`
- mv should preserve all attributes such as timestamps when moving to/from external drive HOT 5
- nushell doesn't handle escaped paths from drag-and-drop on macos HOT 1
- Nushell doesn't throw error on overwriting a variable datatype HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nushell.