Comments (10)
I'm not sure that would work because
export
won't apply to your main shell. It will apply to the bash shell that was triggered when calling the script.So the second time one runs
navi
, the variable will be undefined.
As you say it is not possible to do it with export
. I did it just as an example, it's not possible to do it since command opens different shell processes at background.
from navi.
Maybe #37 solves the same problem and we can close this issue? What do you think?
from navi.
I think what you want to do it is to put the command in the bash readline buffer so you have a chance to edit it before you press enter.
I am working on similar project related to AWS
This is very easy to do in zsh using print -z
.
Unfortunately, I couldn't find a way to do that in Bash cross-platform (Linux/Mac OS)
Here is an issue in stackexchange maybe you will have better luck than me.
from navi.
Thanks for opening your first issue here!
from navi.
I'm not sure I got it. Your concern is with the ---
syntax?
from navi.
I copied line from there https://github.com/denisidoro/navi/blob/master/cheats/docker.cheat#L40
As brief, I have just make new feature request like navi lastcommand
which allows user to run last printed command via navi --print
.
These command can be easy and safe for the peoples which is using the tool.
from navi.
I'm not sure that would work because export
won't apply to your main shell. It will apply to the bash shell that was triggered when calling the script.
So the second time one runs navi
, the variable will be undefined.
from navi.
It seems somewhat related... I want to run: . $(navi --print)
But this doesn't seem to work (when the printed stuff includes export
statements).
Whereas if I do . $(echo <what navi printed out>)
it actually does work. Am unsure about what is happening in the middle, I haven't done enough digging to satisfy myself that it's a navi bug or a bug in the script navi is executing itself. Only adding it here as it may help with this issue
from navi.
Thank you for solution. Also, it gives ability to change the command before execution.
- I did small test about to being sure and found small problem. Cheatsheets which expect interactive input like
type
,port
,name
fails because of input not provided.
Unable to fetch suggestions for 'type'!
You can try this case via:
Ctrl-g
write kubernetes type
or netstat
than press ENTER
- Just small warning about keybinding.
Ctrl-g
is already binded key forzsh
. I never used it but just I am informing here
bindkey | grep get-line
"^[G" get-line
"^[g" get-line
bindkey '\eg' _call_navi
didn't worked for me! I usedbindkey ^g _call_navi
NOTE: This can be related with my machine.
from navi.
Closing in favor of #37
from navi.
Related Issues (20)
- Basic curl cheatsheet doesn't work on zsh due to quoting issues HOT 2
- Respect FZF fg colors or disable text coloring entirely HOT 1
- Clearer information about the `.cheat` files and `navi` config paths HOT 1
- `navi info cheats-path` ignores `$NAVI_PATH` and `$NAVI_CONFIG` HOT 2
- Non-Interactive Cheatsheet Install HOT 6
- Any way to have snippets on the left rather than on the right? HOT 2
- Security concern about Windows binary (v2.23.0) HOT 2
- Enable the use of Bash on Windows for both Navi and fzf HOT 1
- Sort by recency of usage or priority HOT 1
- Unexpected output from zsh widget with input HOT 1
- zsh widget results vary with terminal width
- command not found trying to execute navi on windows HOT 1
- Add another topic for the repo `cheatsheet` HOT 1
- searching doesn't work for descriptions longer than terminal size
- Provide Statically Compiled Binaries for (aarch64|arm64) Linux HOT 1
- Using https://devhints.io/ as a backend HOT 1
- ":/Scoop/apps/gow/current/bin/bash.exe": E:Scoopappsnavi2.23.0navi.exe: command not found HOT 1
- Unable to execute some custom commands HOT 1
- Add optional arguments HOT 1
- Optional placeholder value for variable HOT 3
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 navi.