Skip to content

Commit 01b55a5

Browse files
committed
Document the new run-shell kitten
1 parent 7e35ee3 commit 01b55a5

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Detailed list of changes
4040

4141
- A new escape code ``<ESC>[22J`` that moves the current contents of the screen into the scrollback before clearing it
4242

43+
- A new kitten :ref:`run-shell <run_shell>` to allow creating sub-shells with shell integration enabled
44+
4345
- A new option :opt:`text_fg_override_threshold` to force text colors to have high contrast regardless of color scheme (:pull:`6283`)
4446

4547
- When resizing OS Windows make the animation less jerky. Also show the window size in cells during the resize (:iss:`6341`)

docs/shell-integration.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,39 @@ In order to avoid remote code execution, kitty will only execute the configured
292292
editor and pass the file path to edit to it.
293293

294294

295+
.. _run_shell:
296+
297+
Using shell integration in sub-shells, containers, etc.
298+
-----------------------------------------------------------
299+
300+
To start a sub-shell with shell integration automatically setup, simply run::
301+
302+
kitten run-shell
303+
304+
This will start a sub-shell using the same binary as the currently running
305+
shell, with shell-integration enabled. To start a particular shell use::
306+
307+
kitten run-shell --shell=/bin/bash
308+
309+
To run a command before starting the shell use::
310+
311+
kitten run-shell ls .
312+
313+
This will run ``ls .`` before starting the shell.
314+
315+
This will even work on remote systems where kitty itself is not installed,
316+
provided you use the :doc:`SSH kitten <kittens/ssh>` to connect to the system.
317+
Use ``kitten run-shell --help`` to learn more.
318+
295319
.. _manual_shell_integration:
296320

297321
Manual shell integration
298322
----------------------------
299323

300324
The automatic shell integration is designed to be minimally intrusive, as such
301325
it won't work for sub-shells, terminal multiplexers, containers, etc.
302-
For such systems, you should setup manual shell integration by adding some code
303-
to your shells startup files to load the shell integration script.
326+
For such systems, you should either use the :ref:`run-shell <run_shell>` command described above or
327+
setup manual shell integration by adding some code to your shells startup files to load the shell integration script.
304328

305329
First, in :file:`kitty.conf` set:
306330

tools/cmd/run_shell/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ func EntryPoint(root *cli.Command) *cli.Command {
4444
})
4545
sc.Add(cli.OptionSpec{
4646
Name: "--shell-integration",
47-
Help: "Specify a value for the shell_integration option, overriding the one from kitty.conf.",
47+
Help: "Specify a value for the :opt:`shell_integration` option, overriding the one from :file:`kitty.conf`.",
4848
})
4949
sc.Add(cli.OptionSpec{
5050
Name: "--shell",
5151
Default: ".",
52-
Help: "Specify the shell command to run. The default value of :code:`.` will use the parent shell if recognized, falling back to the value of the :code:`shell` option from kitty.conf.",
52+
Help: "Specify the shell command to run. The default value of :code:`.` will use the parent shell if recognized, falling back to the value of the :opt:`shell` option from :file:`kitty.conf`.",
5353
})
5454
return sc
5555
}

0 commit comments

Comments
 (0)