Skip to content

ts session

Show, terminate, or diagnose an active session.

Usage

text
ts sessions
ts session <id>
ts session terminate <id> [--force]
ts session diagnostics <id>

Description

A session is one user's running application on one server. ts sessions lists what is live right now — who, which application, which server, and how long it has been running.

ts session <id> shows one session in full. ts session diagnostics collects the server-side diagnostic bundle for it, which is the first thing to reach for when someone reports an application behaving badly and you need evidence rather than a description.

ts session terminate ends a session. The user's application stops, so this prompts unless you pass --force. Reach for it when a session is stuck or consuming resources it should not; the user will see the application close.

Sessions end on their own when the user closes the application, so an unexpectedly long-running session is usually the interesting one.

Options

FlagDescriptionDefault/ValuesNotes
--force, -fTerminate without confirming.terminate only.

Examples

bash
# What is running right now?
ts sessions

# One session in detail
ts session 4f21c8e0-91a4-4b7d-8e33-2a6f5c1d0b88

# Collect evidence before doing anything
ts session diagnostics 4f21c8e0-91a4-4b7d-8e33-2a6f5c1d0b88

# End a stuck session
ts session terminate 4f21c8e0-91a4-4b7d-8e33-2a6f5c1d0b88 --force

# Anything running longer than it should be?
ts sessions --csv

Exit Codes

0 on success. -4 when no account is signed in. -5 when the account is not a Server Administrator. -6 when the session id does not exist — which also happens when the session ended between listing it and acting on it.

  • ts report — Historical session data, rather than what is live.
  • ts servers — The servers sessions run on.