issue184:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue184:c_c [2022/08/28 15:11] – créée auntiee | issue184:c_c [2022/08/30 18:57] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Welcome back to another issue of command and conquer. We talked about screen in a previous issue, where I mentioned tmux. This issue is where that happens. | + | **Welcome back to another issue of command and conquer. We talked about screen in a previous issue, where I mentioned tmux. This issue is where that happens. |
Installation | Installation | ||
Ligne 9: | Ligne 9: | ||
Let’s talk about the key combinations and switches here, as that is what tmux revolves around. | Let’s talk about the key combinations and switches here, as that is what tmux revolves around. | ||
- | In the general category, I’d put ‘making mistakes’. Yes, tmux is very helpful in correcting you, if you do. In fact, I’d recommend you make them. This really is the best way to learn. Unlike programming, | + | In the general category, I’d put ‘making mistakes’. Yes, tmux is very helpful in correcting you, if you do. In fact, I’d recommend you make them. This really is the best way to learn. Unlike programming, |
- | Ain’t tmux grand? | + | Bienvenue de retour dans un nouveau numéro de Command & Conquer. Nous avons parlé d' |
+ | |||
+ | Installation | ||
+ | |||
+ | On dit qu'une image vaut mille mots, voyons si cela fonctionne. | ||
+ | |||
+ | Une fois que vous l'avez installé, lancez-le en tapant « tmux » et vous devriez voir une barre apparaître en bas du terminal (voir ci-dessous). | ||
+ | |||
+ | Parlons ici des combinaisons de touches et des interrupteurs, | ||
+ | |||
+ | Dans la catégorie générale, je mettrais « faire des erreurs ». Oui, tmux est très utile pour vous corriger, si vous en faites. En fait, je vous recommande de les faire. C'est vraiment la meilleure façon d' | ||
+ | |||
+ | |||
+ | **Ain’t tmux grand? | ||
If you remember our article on screen, the key combination to tell screen that you were going to give it a command, was CTRL+a. (Let’s call it a “primer”). In tmux, it is CTRL+b. The most important one I’d like to tell you about is the ‘?’. If you press CTRL+b, and then a question mark, help will be displayed. The nice thing here is that you can use your mouse wheel to scroll up and down that list. Though all this may seem silly to GUI users, there will come a time you will have to surf the terminal and why not make it as comfortable as possible? | If you remember our article on screen, the key combination to tell screen that you were going to give it a command, was CTRL+a. (Let’s call it a “primer”). In tmux, it is CTRL+b. The most important one I’d like to tell you about is the ‘?’. If you press CTRL+b, and then a question mark, help will be displayed. The nice thing here is that you can use your mouse wheel to scroll up and down that list. Though all this may seem silly to GUI users, there will come a time you will have to surf the terminal and why not make it as comfortable as possible? | ||
Ligne 17: | Ligne 30: | ||
In tmux, you can have tabs or windows, allowing you to do one thing that may run a while, and open another “window” in the same terminal to do something else. You don’t see another window per-se, but a “new” window within the current one. You can name these windows simply by using the CTRL+b to “prime” it, followed by a ‘,’ (comma). Type the new name and it will be displayed in the bottom instead of “bash” (see above). | In tmux, you can have tabs or windows, allowing you to do one thing that may run a while, and open another “window” in the same terminal to do something else. You don’t see another window per-se, but a “new” window within the current one. You can name these windows simply by using the CTRL+b to “prime” it, followed by a ‘,’ (comma). Type the new name and it will be displayed in the bottom instead of “bash” (see above). | ||
- | This makes it easy to remember what you were doing in which window, if you have a lot of them open. As with screen, p and n will be the previous and next window if you enter them after the primer. If you would like to see all the “windows” that you have open, it is w after the “primer”, | + | This makes it easy to remember what you were doing in which window, if you have a lot of them open. As with screen, p and n will be the previous and next window if you enter them after the primer. If you would like to see all the “windows” that you have open, it is w after the “primer”, |
+ | |||
+ | C'est pas génial, tmux ? | ||
+ | |||
+ | Si vous vous souvenez de notre article sur l' | ||
+ | |||
+ | Dans tmux, vous pouvez avoir des onglets ou des fenêtres, vous permettant de faire une chose qui peut durer un certain temps, et ouvrir une autre « fenêtre » dans le même terminal pour faire autre chose. Vous ne voyez pas une autre fenêtre en soi, mais une « nouvelle » fenêtre dans la fenêtre actuelle. Vous pouvez nommer ces fenêtres en utilisant simplement les touches CTRL+b pour les « amorcer », suivies d'une « , » (virgule). Tapez le nouveau nom et il sera affiché en bas à la place de « bash » (voir ci-dessus). | ||
+ | |||
+ | Cela permet de vous souvenir facilement de ce que vous faisiez dans chaque fenêtre, si vous en avez beaucoup d' | ||
- | Now you may want to kill a window and not the whole terminal. This is where you use the ampersand “&” (which will look different depending on the font). Shift+7 on my keyboard. You should get a prompt to ask you if you’d like to kill it. If you would like to group windows, you can easily move them with the ‘.’ period after the primer, though in all honesty, I have never used that functionality, | + | **Now you may want to kill a window and not the whole terminal. This is where you use the ampersand “&” (which will look different depending on the font). Shift+7 on my keyboard. You should get a prompt to ask you if you’d like to kill it. If you would like to group windows, you can easily move them with the ‘.’ period after the primer, though in all honesty, I have never used that functionality, |
Now tmux is a lot more in-depth than a simple ‘command and conquer’ could cover, but I’d like to cover more bases than hotkeys. Tmux also understands commands. For instance, you can type ‘tmux ls’ to list all of the open windows or sessions. Just like vi / vim, there is a “hidden” menu that appears after you press “:” (colon) after the primer (shown above). | Now tmux is a lot more in-depth than a simple ‘command and conquer’ could cover, but I’d like to cover more bases than hotkeys. Tmux also understands commands. For instance, you can type ‘tmux ls’ to list all of the open windows or sessions. Just like vi / vim, there is a “hidden” menu that appears after you press “:” (colon) after the primer (shown above). | ||
Ligne 25: | Ligne 47: | ||
This allows for even more functionality; | This allows for even more functionality; | ||
- | My advice from earlier stands, type a letter and tab complete to see options here too. Here I typed “set” then tabbed to get results. | + | My advice from earlier stands, type a letter and tab complete to see options here too. Here I typed “set” then tabbed to get results. |
+ | Bon. Vous pouvez vouloir tuer une fenêtre et pas tout le terminal. C'est là que vous utilisez l' | ||
- | But that is not all, you can go a step further and set up a “dotfile” and load that up. When you get to the colon, simply start typing source and tab complete to load a source file: | + | Mais tmux est beaucoup plus profond que ce qu'un simple « Command & Conquer » pourrait couvrir, mais j' |
+ | |||
+ | Cela permet encore plus de fonctionnalités ; par exemple, en tapant le mot « new » après ces deux points, vous ouvrirez une nouvelle fenêtre. Personnellement, | ||
+ | |||
+ | Mon conseil de tout à l' | ||
+ | |||
+ | |||
+ | **But that is not all, you can go a step further and set up a “dotfile” and load that up. When you get to the colon, simply start typing source and tab complete to load a source file: | ||
source-file ~/ | source-file ~/ | ||
Ligne 38: | Ligne 68: | ||
https:// | https:// | ||
- | Some helpful resources. Enjoy. | + | Some helpful resources. Enjoy.** |
- | A lot of Vim jockeys enjoy tmux, because of the bindings you can create. I am honestly not a fan, but I will include a sprinkling here for those of you who are (not listed in those links): | + | Mais ce n'est pas tout, vous pouvez aller un peu plus loin et créer un « dotfile » et le charger. Quand vous arrivez au deux-points, |
+ | |||
+ | fichier-source ~/ | ||
+ | |||
+ | (Vous pouvez récupérer de beaux fichiers sur internet, assurez-vous simplement de les lire d' | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | Quelques ressources utiles. Bonne lecture. | ||
+ | |||
+ | |||
+ | **A lot of Vim jockeys enjoy tmux, because of the bindings you can create. I am honestly not a fan, but I will include a sprinkling here for those of you who are (not listed in those links): | ||
bind s split-window -v | bind s split-window -v | ||
Ligne 77: | Ligne 120: | ||
Which brings me back to the “?”. If you would like to split a pane, say vertically, you can use the “%” after the primer. It is easy to look these up with the built-in help “?”. I will not rehash what you can find there. Please figure out yourself how to use those hotkeys from that, hey it’s a learning experience. You may not use the terminal much just playing minecraft, but once you get into creating your own minecraft server, you may understand. | Which brings me back to the “?”. If you would like to split a pane, say vertically, you can use the “%” after the primer. It is easy to look these up with the built-in help “?”. I will not rehash what you can find there. Please figure out yourself how to use those hotkeys from that, hey it’s a learning experience. You may not use the terminal much just playing minecraft, but once you get into creating your own minecraft server, you may understand. | ||
- | Did we make mistakes? Let us know misc@fullcirclemagazine.org | + | Did we make mistakes? Let us know misc@fullcirclemagazine.org** |
+ | |||
+ | Beaucoup d' | ||
+ | |||
+ | bind s split-window -v | ||
+ | diviser | ||
+ | |||
+ | bind v split-window -h | ||
+ | fractionnement | ||
+ | |||
+ | bind h select-pane -L | ||
+ | touches de mouvement | ||
+ | |||
+ | bind j volet de sélection -D | ||
+ | touches de mouvement | ||
+ | |||
+ | bind k volet de sélection -U | ||
+ | touches de mouvement | ||
+ | |||
+ | bind l select-pane -R | ||
+ | touches de mouvement | ||
+ | |||
+ | setw -g mode-keys vi | ||
+ | touches de mouvement de vim en mode copie | ||
+ | |||
+ | bind - resize-pane -D 1 | ||
+ | redimensionne le volet vers le bas de 1 | ||
+ | |||
+ | bind + resize-pane -U 1 | ||
+ | redimensionne le volet vers le haut de 1 | ||
+ | |||
+ | bind < resize-pane -L 1 | ||
+ | redimensionne le volet vers la gauche de 1 | ||
+ | |||
+ | bind > resize-pane -R 1 | ||
+ | redimensionne le volet à droite de 1 | ||
+ | |||
+ | Ce qui me ramène au « ? ». Si vous souhaitez diviser un volet, par exemple verticalement, | ||
+ | |||
+ | Avons-nous fait des erreurs ? Faites-nous le savoir | ||
issue184/c_c.1661692293.txt.gz · Dernière modification : 2022/08/28 15:11 de auntiee