By default, tmux will give you a list of sessions when you enter ctrl+b, s. This is how you switch between open workspaces quickly. whatevershellrc file, you can just run t whatevs and not worry about its state. Tmux attach -t $1 || tmux new-session -s $1Īdding this to your. If it’s already running, you could use tmux attach -t whatevs to attach to it. If you are, the shell will attempt to activate a desk with the same name as the session.Īt this stage, if you have a desk called whatevs, you can run tmux new-session -s whatevs to create a new tmux session that automatically activates your whatevs desk. This snippet sets up your shell to detect whether you’re running in a tmux session. # Description: scheduled and queue driven jobsĮxport COMPOSEPREFIX="docker-compose -f $" ]] & tmux display-message -p "#S")ĭesk=$(echo "$tsession" | sed -E "s/-+$//g") "Īlias pylint="poetry run pylint tests/ ergot/"Īlias bandit="poetry run bandit -r ergot/"Īlias quality="test format typecheck bandit lint"Ī project with the development flow built in docker compose #!/bin/bash A project based on Python Poetry #!/bin/bashĪlias flake8="poetry run flake8 -max-complexity 10. These are simply aliases in shell files you can do whatever makes your workflow easier - as sparse or comprehensive as you want. typecheck - to run static type analysis.interact - to enter a project’s docker container.build - to build the project and/or container.So what goes into a desk workspace? Whatever fits your workflow. By default, deskfiles live at ~/.desk/desks/ - a great folder to keep under version control. sh file) for each project I work with regularly. Enter deskĭesk is a lightweight workspace manager - essentially just a wrapper for shell scripts that define each workspace. I wanted a setup where I could simply type test in each project and not have to think about it. This is cognitive overhead - and usually involves a few screwups each time I context switch. compose/docker-compose-test.yml run whatever-project pytest tests For example, to run the unit test suite for any given project: # These are all equivalent, depending on the projectĭocker-compose run whatever-project pytest testsĭocker-compose run whatever-project python manage.py testĭocker-compose -f. I regularly work with a dozen different projects - none of which have consistent command usage. Lately I’ve found myself with an D-tier superpower - near-painless workspace switching. You think easy context switching might make you curse less.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |