Open new tab in same directory
Closed this issue · 4 comments
I have URxvt.keysym.Control-t: tabbedex:new_tab
in my .Xdefaults
so whenever I press Ctrl-t
a new tab is opened. But I also want to open new tab and cd into the directory where the button was pressed.
For eg. If I am in a tab with dir /home/user/music/
and if I press Ctrl-Shift-t
then a new tab should be opened and current directory is changed to /home/user/music/
.
I see that issue #13 asks for same feature was closed 4 months ago with some information about pgid-cd.pl
file but I am unable to implement it. Any help will be appreciated, thanks!
pgid-cd.pl
has documentation in it’s source which includes examples of use:
URxvt.tabbedex.tab-arguments: \
-e %~/.urxvt/tabbedex-pgid-cd %p %E
This would make it work for any way you open a tab. If you want this effect only when some key-bindings are used, you need an argument passed to the new_tab
action, e.g.:
URxvt.keysym.Control-t: \
tabbedex:new_tab: -e %~/.urxvt/tabbedex-pgid-cd %p %E
Sorry, I couldn't achieve this. I have added :
URxvt.keysym.Control-t: \
tabbedex:new_tab: -e %~/.urxvt/tabbedex-pgid-cd %p %E
to my .Xdefault
file and copied pgid-cd.pl
file as ~/.urxvt/tabbedex-pgid-cd
. I don't know if I am supposed to do that.
That should work. Is a new tab being created at all? Also, I’m assuming you’ve made the file executable (chmod 755 ~/.urxvt/tabbedex-pgid-cd
). Could you start the terminal from another terminal to see any error messages printed?
Ah, of course. I didn't make the script executable. Thanks a lot for your help.