tmux-python / tmuxp

🖥️ Session manager for tmux, build on libtmux.
https://tmuxp.git-pull.com/
MIT License
4.09k stars 233 forks source link

Better defaults, less verbosity #237

Open rafi opened 7 years ago

rafi commented 7 years ago

Better defaults, less verbosity:

BEFORE                                                                │ AFTER
---                                                                   │ ---
                                                                      │
session_name: acme                                                    │   session_name: acme
start_directory: ./                                                   │   start_directory: ./
suppress_history: false                                               │   windows:
windows:                                                              │     - name: edit
  - window_name: edit                                                 │       panes:
    focus: true                                                       │         - nvim -S ~/.cache/vim/session/acme-react-native.vim
    panes:                                                            │     - name: git
      - nvim -S ~/.cache/vim/session/acme-react-native.vim            │       panes:
  - window_name: git                                                  │         - shell:
    panes:                                                            │           - git status -sb
      - shell_command:                                                │           - git log --graph --all --oneline --decorate
        - git status -sb                                              │     - name: android
        - git log --graph --all --oneline --decorate                  │       layout: main-vertical
  - window_name: android                                              │       panes:
    layout: main-vertical                                             │         - shell:
    panes:                                                            │           - sleep 2
      - focus: true                                                   │           - react-native run-android
        shell_command:                                                │         - shell:
        - sleep 2                                                     │           - sleep 2
        - react-native run-android                                    │           - adb logcat
      - shell_command:                                          ---------→      - react-native start
        - sleep 2                                                     │     - name: db
        - adb logcat                                                  │       layout: main-vertical
      - react-native start                                            │       panes:
  - window_name: db                                                   │         - shell:
    layout: main-vertical                                             │           - sleep 4
    panes:                                                            │           - pgcli -h localhost -U acme acme
      - focus: true                                                   │           - SET search_path = public;
        shell_command:                                                │           - \dn; \dt public.*
        - sleep 4                                                     │         - shell:
        - pgcli -h localhost -U acme acme                             │           - cd ../api
        - SET search_path = public;                                   │           - docker-compose up db redis
        - \dn; \dt public.*                                           │     - name: api
      - shell_command:                                                │       panes:
        - cd ../api                                                   │       - shell:
        - docker-compose up db redis                                  │         - cd ../api
  - window_name: api                                                  │         - sleep 4
    panes:                                                            │         - find . -name '*py' | entr -r docker-compose up api
    - focus: true                                                     │  
      shell_command:                                                  │  
      - cd ../api                                                     │  
      - sleep 4                                                       │  
      - find . -name '*py' | entr -r docker-compose up api            │  
                                                                      │  
stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This bot is used to handle issues where the issue hasn't been discussed or has gone out of date. If an issue isn't resolved and handled in a certain period of time, it may be closed. If you would like your issue re-opened, please create a fresh issue with the latest, up to date information and mention this issue in it.

rightaway commented 4 years ago

@rafi I agree with all of this. As you're a contributor can you incorporate these changes?

tony commented 2 years ago

I like a lot of these suggestions

2.0 will give a fresh look at the config format

libtmux will have similar refinements and cleanup at the API level.

tony commented 2 years ago

Change `suppress_history default to false (Argument: More common to re-use a command after CTRL+C for example, suppress should be the exception)

I agree with this. I often try to reach for the last few commands in the pane.

However, the reason suppress_history is used is the history file itself doesn't get flooded with repeated commands over startups.

If we want a cross platform way to satisfy all worlds i'm all ears

rightaway commented 2 years ago

However, the reason suppress_history is used is the history file itself doesn't get flooded with repeated commands over startups.

@tony People who care about how clean the history file is set their shell settings so that their history files don't have duplicates. It's easy to do in most shells. And other people probably don't even care or know what a history file is.

tony commented 2 years ago

People who care about how clean the history file is set their shell settings so that their history files don't have duplicates.

What would be nice to have instructions for hiding duplicate history on https://tmuxp.git-pull.com

Then I will entertain this behavior as a default. Users need warning before a default like this changes

https://github.com/tmux-python/tmuxp/discussions/760 2.0 is where i'm happy to put in any kind of default behavioral change