kitten-@-close-window(1)

πŸ’… kitten-@-close-window(1) β€” the kitten Manual, bestie edition ✨

okay so this is a page from the kitten manual, and it's about yeeting windows into the void. no cap, it's a tiny page but the --match option is doing the absolute most, so let's get into it πŸŽ€


✨ Name ✨

kitten-@-close-window β€” closes the windows you tell it to close πŸ’€

πŸ¦‹ Usage πŸ¦‹

kitten @ close-window

that's it. that's the whole mood 🫢

🌸 Description 🌸

Close the specified windows πŸ’– (yes, plural β€” you can absolutely catch more than one at a time, iykyk)

πŸ’… Options πŸ’…

  • --match, -m β€” which window(s) you're matching, bestie. match specs go like this: field:query. the field can be one of: id, title, pid, cwd, cmdline, num, env, var, state, neighbor, session and recent. the query is the expression you match against β€” expressions can be a number or a regular expression, and (iconic) you can combine them with Boolean operators πŸ”₯

the special value all matches all windows. every single one. no survivors, periodt.

for the numeric fields β€” id, pid, num and recent β€” the expression is read as a number, not a regular expression. negative values for id match from the highest id number down, and specifically -1 is the most recently created window πŸ‘‘

the field num is the window's position in the current tab, starting from zero and counting clockwise (same order the windows get reported by kitten @ ls, so you know it's legit).

the window id of the current window is hanging out in the KITTY_WINDOW_ID environment variable, in case you need it 🌈

the field recent is about recently active windows in the currently active tab: 0 is the currently active window, 1 is the previously active window, and so on down the line πŸ•°οΈ

the field neighbor is a neighbor of the active window in whatever direction you specify, which can be: left, right, top or bottom 🧭

the field session matches windows that were created in the specified session. use the expression ^$ to match windows that were not created in a session, . to match the currently active session, and ~ to match either the currently active session or the last active session when no session is active ✨

when you're using the env field to match on environment variables, you can give just the environment variable name, or a name and value, like for example env:MY_ENV_VAR=2 πŸ“

same energy for the var field, except it matches on user variables set on the window β€” you can specify name, or name and value, exactly like with the env field πŸ’œ

the field state matches on the state of the window. the supported states are: active, focused, needs_attention, parent_active, parent_focused, focused_os_window, self, overlay_parent. so: active windows are the windows that are active in their parent tab. there's only one focused window and it's the window that keyboard events get delivered to β€” if no window is focused, the last focused window is what gets matched. the value focused_os_window matches all windows in the currently focused OS window. the value self matches the window the remote control command is run in. and the value overlay_parent matches the window that's under the self window, when the self window is an overlay πŸ‘€

little tip from the manpage itself: you can use the kitten @ ls command to get a list of windows πŸ“‹
  • --no-response [=no] β€” don't wait for a response saying whether the action worked. lowkey be careful here β€” using this option means you will not be notified of failures πŸ™ˆ
  • --self [=no] β€” close the window this command is run in, instead of the active window πŸͺŸβœ¨
  • --ignore-no-match [=no] β€” don't return an error if nothing matched, so no windows get closed and nobody throws a fit 😌
  • --help, -h [=no] β€” show help for this command 🫢

πŸ‘‘ Global options πŸ‘‘

these ones are shared across the remote control commands, so they show up everywhere πŸ’«

  • --to β€” an address for the kitty instance you want to control. it corresponds to the address given to the kitty instance via the --listen-on option or the listen_on setting in kitty.conf. if you don't specify it, the environment variable KITTY_LISTEN_ON gets checked. if that's not found either, messages get sent to the controlling terminal for this process β€” meaning they'll only work if this process is run inside a kitty window 🐱
  • --password β€” a password to use when contacting kitty. this makes kitty ask the user for permission to perform the specified action, unless the password was already accepted before or is pre-configured in kitty.conf. to use a blank password, specify --use-password as always πŸ”
  • --password-file [=rc-pass] β€” a file to read the password from. trailing whitespace is ignored. relative paths are resolved from the kitty configuration directory. use - to read from STDIN. use fd:num to read from the file descriptor num. this is used if no --password is supplied. defaults to checking for the rc-pass file in the kitty configuration directory πŸ“
  • --password-env [=KITTY_RC_PASSWORD] β€” the name of an environment variable to read the password from. used if no --password-file is supplied. defaults to checking the environment variable KITTY_RC_PASSWORD 🌱
  • --use-password [=if-available] β€” if no password is available, kitty will usually just send the remote control command without a password. this option forces it to always or never use the supplied password. if set to always and no password is provided, the blank password gets used πŸ’«

choices: if-available, always, never


and that's the whole page, bestie β€” you ate that πŸ“ version 0.49.2, dated Oct 01, 2026, straight from the kitten Manual. go close some windows, you absolute icon πŸ‘‘πŸ’–

πŸ“¦ where this page comes from