# \#session

**URL:** https://discuss.kakoune.com/tag/session/28.md

[Latest](https://discuss.kakoune.com/latest.md) · [Categories](https://discuss.kakoune.com/categories.md) · [Tags](https://discuss.kakoune.com/tags.md)

---

## [One kakoune session per project with direnv and connect.kak?](https://discuss.kakoune.com/t/one-kakoune-session-per-project-with-direnv-and-connect-kak/1056)

<div class="topic-metadata">

**Author:** [@tbdcit](https://discuss.kakoune.com/u/tbdcit)\
**Replies:** 6\
**Last updated:** [March 25, 2022, 6:58pm UTC](https://discuss.kakoune.com/t/one-kakoune-session-per-project-with-direnv-and-connect-kak/1056 "2022-03-25T18:58:13Z")

</div>

Hi there! I have been lurking for a while here and thought it was about time to post a question. I recently found the excellent tool direnv which sets environment variables in your shell based on which directory you are…

---

## [Get the wrong tmux session when connecting kakoune to a given session](https://discuss.kakoune.com/t/get-the-wrong-tmux-session-when-connecting-kakoune-to-a-given-session/1791)

<div class="topic-metadata">

**Author:** [@scr](https://discuss.kakoune.com/u/scr)\
**Replies:** 5\
**Last updated:** [June 23, 2021, 1:37pm UTC](https://discuss.kakoune.com/t/get-the-wrong-tmux-session-when-connecting-kakoune-to-a-given-session/1791 "2021-06-23T13:37:31Z")

</div>

Hello, Let’s say that I start a kakoune session named “k1” in a tmux session named “t1”. Then I open a new terminal with a new tmux session “t2”, and start a kakoune client connect to “k1” ( kak -c k1) Now if I want …

---

## [Silently add a new buffer to a kakoune session](https://discuss.kakoune.com/t/silently-add-a-new-buffer-to-a-kakoune-session/1792)

<div class="topic-metadata">

**Author:** [@scr](https://discuss.kakoune.com/u/scr)\
**Replies:** 1\
**Last updated:** [June 23, 2021, 12:34pm UTC](https://discuss.kakoune.com/t/silently-add-a-new-buffer-to-a-kakoune-session/1792 "2021-06-23T12:34:46Z")

</div>

Is there a way form an external script to seemlessly and silently add a new buffer to an existing kakoune session ? For now I use kcr to run an :edit and :exec ga but it create an anoying glitch

---

## [Session management: 1 session per desktop on bspwm](https://discuss.kakoune.com/t/session-management-1-session-per-desktop-on-bspwm/1281)

<div class="topic-metadata">

**Author:** [@SeerLite](https://discuss.kakoune.com/u/SeerLite)\
**Replies:** 10\
**Last updated:** [January 26, 2021, 6:46pm UTC](https://discuss.kakoune.com/t/session-management-1-session-per-desktop-on-bspwm/1281 "2021-01-26T18:46:13Z")

</div>

Hi everyone! Here’s a simple session management setup I came up with a few weeks ago that I wanted to share. I use the following as a kak wrapper: desktop="$(bspc query -D -d 2\>/dev/null)" # bspc result was empty, so …

---

## [How can I preserve my current working environment across reboots?](https://discuss.kakoune.com/t/how-can-i-preserve-my-current-working-environment-across-reboots/1240)

<div class="topic-metadata">

**Author:** [@blaggacao](https://discuss.kakoune.com/u/blaggacao)\
**Replies:** 6\
**Last updated:** [August 31, 2020, 7:45am UTC](https://discuss.kakoune.com/t/how-can-i-preserve-my-current-working-environment-across-reboots/1240 "2020-08-31T07:45:15Z")

</div>

After work I want to preserve the current state with open buffers, etc so that when I startup again, I’m greeted by that scratch buffer reminding me where I just took of. Such thing would greatly help in getting off the…

---

## [Join session command](https://discuss.kakoune.com/t/join-session-command/1227)

<div class="topic-metadata">

**Author:** [@mogenson](https://discuss.kakoune.com/u/mogenson)\
**Replies:** 1\
**Last updated:** [August 24, 2020, 3:44pm UTC](https://discuss.kakoune.com/t/join-session-command/1227 "2020-08-24T15:44:05Z")

</div>

Hello, Is there a way to join an existing session from within a kak client? I only see the rename-session command.

---

## [Creating "sessions" like Vim and Emacs](https://discuss.kakoune.com/t/creating-sessions-like-vim-and-emacs/1123)

<div class="topic-metadata">

**Author:** [@The-BigDaddy](https://discuss.kakoune.com/u/The-BigDaddy)\
**Replies:** 1\
**Last updated:** [July 1, 2020, 9:16am UTC](https://discuss.kakoune.com/t/creating-sessions-like-vim-and-emacs/1123 "2020-07-01T09:16:14Z")

</div>

Hey people. So in my forever deep dive into UNIX text editors, I saw that Vim can have sessions for currently open files, and you can open them up again with vim -S \<session-file-name\>. Emacs can do this as well with d…

---

## [Setting/writing/modifying session file history?](https://discuss.kakoune.com/t/setting-writing-modifying-session-file-history/1084)

<div class="topic-metadata">

**Author:** [@kanashimia](https://discuss.kakoune.com/u/kanashimia)\
**Replies:** 1\
**Last updated:** [June 12, 2020, 3:49pm UTC](https://discuss.kakoune.com/t/setting-writing-modifying-session-file-history/1084 "2020-06-12T15:49:47Z")

</div>

So we have history expansion, and it allows us to read it in a nice format, but is there a way to write into it? For registers we can use set-register command, and it allows us to have eg command history. But what about …

---

## [Saving selection state across sessions](https://discuss.kakoune.com/t/saving-selection-state-across-sessions/87)

<div class="topic-metadata">

**Author:** [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Replies:** 6\
**Last updated:** [February 9, 2020, 8:04am UTC](https://discuss.kakoune.com/t/saving-selection-state-across-sessions/87 "2020-02-09T08:04:50Z")

</div>

A while ago I created the state-save plugin which automatically saves the selection state as you edit a file and restores it the next time you open that file. I recently updated it and figured I should advertise it here! …

---

## [One session for all projects](https://discuss.kakoune.com/t/one-session-for-all-projects/473)

<div class="topic-metadata">

**Author:** [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Replies:** 14\
**Last updated:** [October 21, 2019, 6:16am UTC](https://discuss.kakoune.com/t/one-session-for-all-projects/473 "2019-10-21T06:16:04Z")

</div>

I’m experimenting with @ulis’s workflow to live with a single session. In this workflow, I use buffer and find-edit commands quite intensively, and one thing I missed was the ability to switch to the project root of the…

---

## [Kak session manager snippet](https://discuss.kakoune.com/t/kak-session-manager-snippet/731)

<div class="topic-metadata">

**Author:** [@mogenson](https://discuss.kakoune.com/u/mogenson)\
**Replies:** 7\
**Last updated:** [October 1, 2019, 2:35pm UTC](https://discuss.kakoune.com/t/kak-session-manager-snippet/731 "2019-10-01T14:35:37Z")

</div>

Thought I would share some snippets here about how I manage my kakoune sessions, in case it’s useful for anyone else. I prefer to have one session per git repo named after the path to the repository, stripped of non-alp…
