joouha / ranger_tmux Goto Github PK
View Code? Open in Web Editor NEWTmux integration for ranger
License: MIT License
Tmux integration for ranger
License: MIT License
I set up the following and it failed.
$ pacman -Q ranger
ranger 1.9.3-9
$
$ cd ~/.config/ranger/plugins
$
$ git clone --depth 1 https://github.com/joouha/ranger_tmux
Cloning into 'ranger_tmux'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 24 (delta 1), reused 13 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), 24.84 KiB | 4.14 MiB/s, done.
Resolving deltas: 100% (1/1), done.
$
$ ls -la ranger_tmux
total 68
drwxr-xr-x 1 a a 206 Jul 5 19:32 .
drwxr-xr-x 1 a a 230 Jul 5 19:32 ..
-rw-r--r-- 1 a a 320 Jul 5 19:32 .flake8
drwxr-xr-x 1 a a 152 Jul 5 19:32 .git
-rw-r--r-- 1 a a 4070 Jul 5 19:32 .gitignore
-rw-r--r-- 1 a a 789 Jul 5 19:32 .pre-commit-config.yaml
-rw-r--r-- 1 a a 1079 Jul 5 19:32 LICENSE
-rw-r--r-- 1 a a 4931 Jul 5 19:32 README.md
-rw-r--r-- 1 a a 38231 Jul 5 19:32 poetry.lock
-rw-r--r-- 1 a a 885 Jul 5 19:32 pyproject.toml
drwxr-xr-x 1 a a 246 Jul 5 19:32 ranger_tmux
drwxr-xr-x 1 a a 20 Jul 5 19:32 scripts
$
$ tail -n 7 ../rc.conf
# ranger_tmux https://github.com/joouha/ranger_tmux
set tmux_cwd_sync true
set tmux_cwd_track true
set tmux_set_title true
set tmux_open_in_window true
set tmux_dropdown_percent 60
$ ranger
The option named `tmux_cwd_sync' does not exist
The option named `tmux_cwd_track' does not exist
The option named `tmux_set_title' does not exist
The option named `tmux_open_in_window' does not exist
The option named `tmux_dropdown_percent' does not exist
$
I may be making some basic mistake, sorry.
What should I do to get it to work?
enviroment:
The plugin installed properly. After trying to execute a command or set a flag i got such the error.
22:38:30 ERRO invalid literal for int() with base 10: ''
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ranger/core/actions.py", line 271, in execute_console
cmd.execute()
File "/home/user/.local/lib/python3.8/site-packages/ranger_tmux/cwd_sync.py", line 16, in execute
pane_id = util.select_shell_pane(self.ranger_pane)
File "/home/user/.local/lib/python3.8/site-packages/ranger_tmux/util.py", line 72, in select_shell_pane
has_marked_pane = int(
ValueError: invalid literal for int() with base 10: ''
The problem is there is no variable "#{window_marked_flag}"
.
Current format window variables:
window_active 1 if window active
window_activity Time of window last activity
window_activity_flag 1 if window has activity
window_bell_flag 1 if window has bell
window_bigger 1 if window is larger than client
window_end_flag 1 if window has the highest index
window_flags #F Window flags
window_format 1 if format is for a window (not assuming the current)
window_height Height of window
window_id Unique window ID
window_index #I Index of window
window_last_flag 1 if window is the last used
window_layout Window layout description, ignoring zoomed window panes
window_linked 1 if window is linked across sessions
window_name #W Name of window
window_offset_x X offset into window if larger than client
window_offset_y Y offset into window if larger than client
window_panes Number of panes in window
window_silence_flag 1 if window has silence alert
window_stack_index Index in session most recent stack
window_start_flag 1 if window has the lowest index
window_visible_layout Window layout description, respecting zoomed window panes
window_width Width of window
window_zoomed_flag 1 if window is zoomed
wrap_flag Pane wrap flag
❯ tmux -V
tmux 3.0a
May be in the older or newer versions the variable exists, i didn't check it.
I fixed it easily and can make a Pull Request, don't you mind about it?
Simply changed definition of the has_marked_pane
variable
from
has_marked_pane = int(
tmux("display", "-p", "-F", "#{window_marked_flag}", "-t", ranger_pane)
)
to
marks = tmux("display", "-p", "-F", "#{window_flags}", "-t", ranger_pane)
# marks var contains for instance the following symbols "*MZ" or "*" if empty
has_marked_pane = 'M' in marks
Hi
It's really annoying to see the terminal clutter up with cd's, could there be anything done about this?
Thank you in advance
I hope you are doing great!
This plugin is really great, thank you for having had this idea!
I would like to ask you some assistance on the drop down
feature.
I couldn't figure it out what is wrong on my system settings cause it's not working properly.
Attached you find the images about the python output when I run the command python -m ranger_tmux.drop
.
I have installed the plugin using pip command.
ranger_tmux/set_window_name.py line 11 is causing an error.
I am running tmux 2.6 and I get an error message saying -p
is not an available option for set-option
It appears you are trying to set the pane name so I get an error running ranger from a tmux window without any split panes. You should be setting window name with -w
instead?
When running python3 -m ranger_tmux install
I got this error because the directory ~/.config/ranger/plugins
did not exist:
FileNotFoundError: [Errno 2] No such file or directory: '/home/yuri/.local/lib/python3.11/site-packages/ranger_tmux/plugin.py' -> '/home/yuri/.config/ranger/plugins/ranger_tmux.py'
But then I fixed by creating the directory and running the install script again.
The install script should create the dir if not exists to avoid that error.
Hey. What do you think about having an option for a command tmux_cwd_sync_now
?
I often press xc
and always go to a pane i synced and think there might be an option something like tmux_cwd_sync_now select=True
or tmux_cwd_sync_now focus=True
to reduce the repeatable action.
Then this option can be set up as default in a config or one more shortcut is added.
When following README and attempting to install, if ~/.config/ranger/plugins folder is missing, the install fails with the following error:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/opt/homebrew/lib/python3.9/site-packages/ranger_tmux/__main__.py", line 192, in <module>
main()
File "/opt/homebrew/lib/python3.9/site-packages/ranger_tmux/__main__.py", line 188, in main
args.func(args)
File "/opt/homebrew/lib/python3.9/site-packages/ranger_tmux/__main__.py", line 105, in install
args.ranger_plugin_path.symlink_to(args.plugin_script_path)
File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 1403, in symlink_to
self._accessor.symlink(target, self, target_is_directory)
File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 456, in symlink
return os.symlink(a, b)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/homebrew/lib/python3.9/site-packages/ranger_tmux/plugin.py' -> '/Users/sashka/.config/ranger/plugins/ranger_tmux.py'
The README does mention to clone into ranger plugin folder, but I think it may be better to allow for global pip module location install.
Hi, the installation does not work for me.
python -m ranger_tmux install
yields
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/ole/.local/lib/python3.8/site-packages/ranger_tmux/__main__.py", line 193, in <module>
main()
File "/home/ole/.local/lib/python3.8/site-packages/ranger_tmux/__main__.py", line 172, in main
default=importlib_resources.files("ranger_tmux").joinpath("plugin.py"),
AttributeError: module 'importlib.resources' has no attribute 'files'
I've tried downloading both ranger-tmux
and ranger_tmux
. Is this a bug? Or is there any unlisted installation requirements?
Note that this is the first ranger plugin that I am installing.
Hi there,
I was wondering whether it is possible to set ranger to open in a vertical split (from the right) rather than the default of opening in a horizontal split from the top. If not, would it be possible to add to the extension?
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.