<https://github.com/cbeust/kash>
# feed
c
👍🏻 2
😯 1
💥 11
💵 6
😱 4
c
I was just thinking about this idea the other day, I’ll have to give it a shot soon!
c
Feedback welcome!
i
So cache, essentially is kotlin repl + a number of built-in functions/properties that mimic coreutils and bash?
c
@Ibragimov Yes, that’s the idea, although technically, it’s not a REPL that understands bash commands, it’s a core that reads lines and interprets them either as commands or Kotlin
👍 1
After having tried so many ways on bash and zsh to implement a smart prompt which all failed in bizarre ways, it was a relief to implement my prompt in Kotlin. And that one works all the time 🙂
s
Copy code
~/code/kash(master) » ./run                                                                                                                                                            
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
You forgot to checkin the gradle jar file.
c
oops
Let me fix that
It was .gitignored, duh. Pull again, @suresh
s
👍
generating a native-image (graalvm) would nice
c
Good idea, I haven't quite thought about the packaging.
c
all classes need to be known at native image generation time so that the static analysis can process them.
This might be an issue if I want users of Kash to be able to add their own classpath before the shell launches
I was leaning toward a wrapper approach for now, like Kobalt/Gradle.
s
yeah that’s the limitation for AOT compilation.
jdk11 still has this warning message
Copy code
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.com.intellij.openapi.util.JDOMUtil$2 (file:/Users/sgopal1/code/kash/build/libs/kosh-fat.jar) to constructor com.sun.xml.internal.stream.XMLInputFactoryImpl()
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.com.intellij.openapi.util.JDOMUtil$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
c
I'm running jdk-11.0.3 and not seeing that message
How do you make it happen?
s
oops sorry jdk12
Copy code
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment (build 12+33)
OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)
c
Bleeding edge uh
Is it working otherwise?
s
yes 👍
r
Wow
j
Is there a reason you named the fat jar
kosh-fat
(instead of for example
kash-fat
)? Or just a consistent typo (in
build.gradle.kts
,
kash
,
kash-debug
and
run
)?
c
I initially called the project
kosh
until I realized that
kash
would be a much better name, with the dollar sign and all. I forgot to rename in a few places...
j
👍
b
Is there shell compatibility for redirecting stderr? In bash you could do
2> /dev/null
to suppress errors
c
It's trivial to add
@bdawg.io I just added support for
2>
, let me know how it works for you
🎉 3