Giter Site home page Giter Site logo

ranger_tmux's People

Contributors

4l1fe avatar joouha avatar tavisrudd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ranger_tmux's Issues

Setup on Arch Linux

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:

  • OS: Arch Linux x86_64
  • Kernel: 6.3.8-arch1-1
  • WM: sway

invalid literal for int() with base 10. Probably tmux version incompatibility.

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

ranger_tmux.drop not workin

Hi there!

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.

Thank you in advance and have a great day!
ranger_plugin
ranger_plugin1

Error with rename window

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?

Create ranger plugins dir if not exists

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.

tmux_cwd_sync_now optionally select a pane

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.

Installation fails if ~/.config/ranger/plugins does not exist

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.

tmux ranger dropdown not working

the tmux commnad prefix-bckspace outputs : " '/usr/bin/python3 -m ranger_tmux.drop' returned 1 "

when executing it manually inside the ranger_tmux dir it works
but outside of that dir it does not
image

inside of the dir:
image

when using the command it does not matter where you are it won't work:
image

Installation error

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.

Feature request: Open ranger on a vertical split

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!

tmux.drop not functioning

Hello, the tmux drop down doesn't function correctly.

I got a screenshot of the error that pops up when I try the Prefix+Bspace combo.

Screenshot 2023-07-18 at 8 55 17 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.