# \<newbie\> ELI5 how integration with shell works

**URL:** <https://discuss.kakoune.com/t/newbie-eli5-how-integration-with-shell-works/2366>\
**Category:** Terminal Tools\
**Created:** [December 23, 2023, 10:24am UTC](https://discuss.kakoune.com/t/newbie-eli5-how-integration-with-shell-works/2366 "2023-12-23T10:24:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tototest99](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/tototest99/32/629_2.png) [@tototest99](https://discuss.kakoune.com/u/tototest99)\
**Post date:** [December 23, 2023, 11:01am UTC](https://discuss.kakoune.com/t/newbie-eli5-how-integration-with-shell-works/2366/2 "2023-12-23T11:01:06Z")

</div>

The key to grokening is to understand that `kak` manage subprocesses (POSIX sh processes) and has way of communicating by e.g. setting environment variables in such subprocess; most notably when you `… %sh{…}`. You can communicate back with e.g. `kak -p` or more comfortably for simple cases with `:eval %sh{…}`.

The previous paragraph assume prerequisites: familiar with UNIXes, reading `:doc execeval` `:doc expansions`.

I suggest to use plugins you mention only if it bring immediate positive result without too much configuration. You will not be able to integrate them elegantly with your other UNIX tools and setting|getting from Kakoune client|session in general if you do not understand Kakoune architecture, which is a bit more complicated (client/server) than I vaguely described.

Another advice as learning exercise is to try to pass simple message between Kakoune and an executable with `:eval %sh{…}`, e.g. try to do arithmetics by calling `python` or `lua` or `bc` on selection content (`$kak_selection`) and pass the result back to Kakoune with `printf` in the `%sh{…}` block.

You should use search feature of this forum for particular goal. One of your question is basically format-on-write and has been answered in multiple threads, see `:doc hooks`, and for “simple” integration with linters/formatters, see the [wiki](https://github.com/mawww/kakoune/wiki)

for other tutorials, see [Intro to Kakoune … articles](https://zork.net/~st/jottings/all_pages.html), and in particular [Languages · mawww/kakoune Wiki · GitHub](https://github.com/mawww/kakoune/wiki/Languages)

have courage, it’s worth it.

---

_[View the full topic](https://discuss.kakoune.com/t/newbie-eli5-how-integration-with-shell-works/2366)._
