Skip to content

Commit 012881b

Browse files
Sarah Edwards2percentsilklucascosti
authored
Document codespaces timeout setting (#23107)
Co-authored-by: Allison Weins <3174849+2percentsilk@users.noreply.github.com> Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
1 parent 066e076 commit 012881b

4 files changed

Lines changed: 48 additions & 1 deletion

File tree

81.8 KB
Loading

content/codespaces/customizing-your-codespace/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ children:
1414
- /changing-the-machine-type-for-your-codespace
1515
- /setting-your-default-editor-for-codespaces
1616
- /setting-your-default-region-for-codespaces
17+
- /setting-your-timeout-period-for-codespaces
1718
- /prebuilding-codespaces-for-your-project
1819
---
1920

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Setting your timeout period for Codespaces
3+
intro: 'You can set your default timeout for {% data variables.product.prodname_codespaces %} in your personal settings page.'
4+
product: '{% data reusables.gated-features.codespaces %}'
5+
versions:
6+
fpt: '*'
7+
ghec: '*'
8+
topics:
9+
- Codespaces
10+
shortTitle: Set the timeout
11+
---
12+
13+
A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.
14+
15+
{% warning %}
16+
17+
**Warning**: Codespaces are billed per minute. If you are not actively using a codespace but the codespace has not yet timed out, you are still billed for the time that the codespace is running. For more information, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
18+
19+
{% endwarning %}
20+
21+
## Setting your default timeout
22+
23+
{% include tool-switcher %}
24+
25+
{% webui %}
26+
27+
{% data reusables.user_settings.access_settings %}
28+
{% data reusables.user_settings.codespaces-tab %}
29+
1. Under "Default idle timeout", enter the time that you want, then click **Save**. The time must be between 5 minutes and 240 minutes (4 hours).
30+
![Selecting your timeout](/assets/images/help/codespaces/setting-default-timeout.png)
31+
32+
{% endwebui %}
33+
34+
{% cli %}
35+
36+
{% data reusables.cli.cli-learn-more %}
37+
38+
To set the timeout period, use the `idle-timeout` argument with the `codespace create` subcommand. Specify the time in minutes, followed by `m`. The time must be between 5 minutes and 240 minutes (5 hours).
39+
40+
```shell
41+
gh codespace create --idle-timeout 90m
42+
```
43+
44+
If you do not specify a timeout period when creating a codespace, then your default timeout period will be used. You cannot currently specify a default timeout period for all future codespaces through {% data variables.product.prodname_cli %}.
45+
46+
{% endcli %}

content/codespaces/developing-in-codespaces/codespaces-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ If you have unsaved changes, your editor will prompt you to save them before exi
3333

3434
## Codespaces timeouts
3535

36-
If you leave your codespace running without interaction or if you exit your codespace without explicitly stopping it, the codespace will timeout after 30 minutes of inactivity and stop running. For more information, see "[Stopping a codespace](#stopping-a-codespace)."
36+
If you leave your codespace running without interaction, or if you exit your codespace without explicitly stopping it, the codespace will timeout after a period of inactivity and stop running. By default, a codespace will timeout after 30 minutes of inactivity, but you can customize the duration of the timeout period for new codespaces that you create. For more information about setting the default timeout period for your codespaces, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)." For more information about stopping a codespace, see "[Stopping a codespace](#stopping-a-codespace)."
3737

3838
When a codespace times out, your data is preserved from the last time your changes were saved. For more information, see "[Saving changes in a codespace](#saving-changes-in-a-codespace)."
3939

0 commit comments

Comments
 (0)