-
Hi! Discovered niri this week, and I think it's getting me to finally leave i3. Thanks for the awesome work, everyone! 💚 One feature I used all the time on X.Org is opening new terminal in the current working directory of my currently focused terminal, using xcwd. I used it like this:
Has some found (or built) a Wayland version of xcwd? The way it works is to find the deepest child of the currently focused window, and look up its working directory. I guess one could cobble something together using |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey, I think you can script this. |
Beta Was this translation helpful? Give feedback.
-
Decided to write my own little tool for this, which I called ycwd :) It allows you to write a key binding like this:
It could be neat to even include the logic for how to find the focused window for different compositors? Thanks for the pointer to |
Beta Was this translation helpful? Give feedback.
-
This exists out of the box in Foot, just place the following in your osc7_cwd() {
# Ctrl + Shift + N opens new terminal at PWD
local strlen=${#PWD}
local encoded=""
local pos c o
for ((pos = 0; pos < strlen; pos++)); do
c=${PWD:$pos:1}
case "$c" in
[-/:_.!\'\(\)~[:alnum:]]) o="${c}" ;;
*) printf -v o '%%%02X' "'${c}" ;;
esac
encoded+="${o}"
done
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
}
PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND%;}; }osc7_cwd |
Beta Was this translation helpful? Give feedback.
Decided to write my own little tool for this, which I called ycwd :) It allows you to write a key binding like this:
It could be neat to even include the logic for how to find the focused window for different compositors?
Thanks for the pointer to
niri msg
, @YaLTeR!