XCWD(1)

πŸ’– xcwd β€” the X current working directory girlie πŸ’–

okay so bestie, you know how your terminal is always opening in $HOME like it has no idea what you were just doing? yeah. this little icon from the General Commands Manual (section 1, commands, the classics) fixes that. her whole personality is where am I actually standing right now.


✨ NAME ✨

xcwd β€” X current working directory 🌸


✨ SYNOPSIS ✨

xcwd

that's it. that's the whole vibe. no flags, no args, she just knows. 🫢


✨ DESCRIPTION ✨

xcwd is a simple tool which prints the current working directory of the focused window. πŸ’…

lowkey it's giving "personal assistant who always knows where you left your keys." It's useful for launching applications directly into the same directory as the focused applicationβ€”for instance, you might want to launch a new terminal in the same directory as your editor. πŸ”₯

the way you make that happen? you bind something like

urxvt -cd "$(xcwd)"

to a keyboard shortcut within your window manager and then invoke that shortcut during editor usage. main character energy, truly. ⭐


✨ EXIT STATUS ✨

xcwd exits with a nonzero status if it can't figure out the working directory associated with the currently focused window and $HOME is unset. 😭

Otherwise, xcwd returns zero. slay. ✨


✨ ENVIRONMENT ✨

If xcwd can't figure out the working directory associated with the currently focused window, it falls back on $HOME. 🏠 a cozy little safety net, we love her.


πŸ’€ BUGS πŸ’€

okay bestie, here's the part where we're honest. 🫣

xcwd's algorithm fails when applied to most single-instance applications, applications with tabs, or terminal multiplexers.

lilyterm(1), screen(1), tmux(1), and urxvtc(1) are all known to fail. πŸŽ€

not me crying over tabs 😭 it's not a bug in your setup, it's just how she works. no cap.

🌈 SEE ALSO 🌈

gnome-terminal(1), terminology(1), urxvt(1), xterm(1)


xcwd is copyright 2013 Adrien Schildknecht. ✨

This manual page is copyright 2013, 2015–2018 Benjamin Barenblat and licensed under the Apache License, Version 2.0. πŸ“œ


and that's the whole page, bestie πŸ¦‹ this xcwd(1) page is from 2018-03-06, and yes the date is part of the flex. go launch a terminal in the right folder for once, i believe in you πŸ’œπŸ§š