Giter Site home page Giter Site logo

Comments (10)

ilikejam avatar ilikejam commented on June 6, 2024 1

Hi!

That sounds reasonable.

The only issue is that it's not (as far as I'm aware) possible to re-balance panes across different columns, so if you get a lot of closed sessions in one column you'll end up with very different sized panes.

Try the script in https://github.com/ilikejam/csshi/tree/3-close-panes-with-ended-session , see if it does what you expect.

from csshi.

ilikejam avatar ilikejam commented on June 6, 2024 1

Cool. Try the new version in https://github.com/ilikejam/csshi/tree/3-close-panes-with-ended-session with '-d' and '-k' again - should hopefully work now!

from csshi.

ilikejam avatar ilikejam commented on June 6, 2024

'-k' flag for autoclose.

from csshi.

lderugeriis avatar lderugeriis commented on June 6, 2024

Thanks for the fast response! Unfortunately with or without -k it doesn't seem to make any difference for me. I've ended up with a bunch of panes with "===Session Ended===" on them.

from csshi.

ilikejam avatar ilikejam commented on June 6, 2024

That's odd. Can you run it with '-d' and add the debug output from the csshi command here? (Remove anything that's secret!)

from csshi.

ilikejam avatar ilikejam commented on June 6, 2024

Could be that the sessions are ending before the panes are set to auto-close. Might have to rethink the strategy.

from csshi.

lderugeriis avatar lderugeriis commented on June 6, 2024

Sure!

DEBUG: SSH command for host myhost91.mydomain is: ssh myhost91.mydomain
DEBUG: SSH command for host myhost92.mydomain is: ssh myhost92.mydomain
DEBUG: SSH command for host myhost93.mydomain is: ssh myhost93.mydomain
DEBUG: SSH command for host myhost94.mydomain is: ssh myhost94.mydomain
DEBUG: SSH command for host myhost95.mydomain is: ssh myhost95.mydomain
DEBUG: Using shell /usr/local/bin/bash
DEBUG: Entering main()
DEBUG: Launching iTerm...
DEBUG: iTerm launched
DEBUG: Command string is /usr/local/bin/bash -l -c '{ssh_string}'
DEBUG: Connecting to iTerm
DEBUG: Connected
DEBUG: Launching 1st pane
DEBUG: Splitting pane for ssh
DEBUG: Splitting pane for ssh
DEBUG: Splitting pane for ssh
DEBUG: Splitting pane for ssh
DEBUG: Enabling input broadcast
DEBUG: Arranging panes
DEBUG: Activating 1st pane
DEBUG: Setting close_sessions_on_end to True
DEBUG: Main has completed. Exiting.

Since I have only 3 active hosts there, there result is a window with 2 columns.

  • 1st column: host1 (active), host3(active), host5(inactive, ===session ended ===)
  • 2nd column: host2 (active), host4(inactive, ===session ended ===)

from csshi.

lderugeriis avatar lderugeriis commented on June 6, 2024

It works like a champ!! Thanks for your effort, it wasn't that easy.
What about this?

that it's not (as far as I'm aware) possible to re-balance panes across different columns

I ended up with 9 active servers splitted in 4 coluimns (1 pane, 3 panes, 2 panes, 2 panes each). Maybe is it possible to wait for the ssh connection to be estabilished before creating the next split? No I'm afraid you calculate the total number of columns required based on the number of hosts given on the command line.
Anyway I'm amazed that you implemented that feature and it's good enough as it is!

from csshi.

ilikejam avatar ilikejam commented on June 6, 2024

It all feels a bit of a hack, splitting panes to make new sessions, but that's what we've got to play with. Once the panes are split, there isn't much manipulation you can do. There's a 7 year old bug open to add this functionality to the APIs, so I don't think anything's going to change any time soon.

Glad it's working for you though!

I'll do some cleanup (that main function's getting a bit long) and merge the changes when I get a minute. I'll ponder some more though - maybe there is a better way...

from csshi.

lderugeriis avatar lderugeriis commented on June 6, 2024

Thanks a lot for your effort! I'm going to comment on that bug for sure.

from csshi.

Related Issues (5)

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.