docs: translate user documentation to French
Make the user-facing documentation readable for the French-speaking team. Anchors, roles and cross-references are unchanged so existing links keep resolving.
This commit is contained in:
12 files changed
+1064
-925
No files matched your search
+124
-110
@@ -1,128 +1,139 @@
|
||||
The :command:`launch` command
|
||||
La commande :command:`launch`
|
||||
--------------------------------
|
||||
|
||||
.. program:: launch
|
||||
|
||||
|
||||
|kitty| has a :code:`launch` action that can be used to run arbitrary programs
|
||||
in new windows/tabs. It can be mapped to user defined shortcuts in
|
||||
:file:`kitty.conf`. It is very powerful and allows sending the contents of the
|
||||
current window to the launched program, as well as many other options.
|
||||
|kitty| dispose d'une action :code:`launch` qui permet de lancer des programmes
|
||||
arbitraires dans de nouvelles fenêtres ou de nouveaux onglets. Elle peut être
|
||||
associée à des raccourcis définis par l'utilisateur dans :file:`kitty.conf`.
|
||||
Elle est très puissante et permet d'envoyer le contenu de la fenêtre courante au
|
||||
programme lancé, ainsi que bien d'autres options.
|
||||
|
||||
In the simplest form, you can use it to open a new kitty window running the
|
||||
shell, as shown below::
|
||||
Dans sa forme la plus simple, vous pouvez l'utiliser pour ouvrir une nouvelle
|
||||
fenêtre kitty exécutant le shell, comme montré ci-dessous ::
|
||||
|
||||
map f1 launch
|
||||
|
||||
To run a different program simply pass the command line as arguments to launch::
|
||||
Pour lancer un autre programme, passez simplement la ligne de commande en
|
||||
arguments à launch ::
|
||||
|
||||
map f1 launch vim path/to/some/file
|
||||
|
||||
To open a new window with the same working directory as the currently active
|
||||
window::
|
||||
Pour ouvrir une nouvelle fenêtre dans le même répertoire de travail que la
|
||||
fenêtre actuellement active ::
|
||||
|
||||
map f1 launch --cwd=current
|
||||
|
||||
To open the new window in a new tab::
|
||||
Pour ouvrir la nouvelle fenêtre dans un nouvel onglet ::
|
||||
|
||||
map f1 launch --type=tab
|
||||
|
||||
To open a window docked to the bottom of the active window, using ten lines,
|
||||
see :ref:`docks`::
|
||||
Pour ouvrir une fenêtre ancrée en bas de la fenêtre active, sur dix lignes, voir
|
||||
:ref:`docks` ::
|
||||
|
||||
map f1 launch --type=window-dock --dock-edge=bottom --dock-size=10
|
||||
|
||||
To run multiple commands in a shell, use::
|
||||
Pour lancer plusieurs commandes dans un shell, utilisez ::
|
||||
|
||||
map f1 launch sh -c "ls && exec zsh"
|
||||
|
||||
To pass the contents of the current screen and scrollback to the started
|
||||
process::
|
||||
Pour passer le contenu de l'écran courant et de l'historique au processus
|
||||
démarré ::
|
||||
|
||||
map f1 launch --stdin-source=@screen_scrollback less
|
||||
|
||||
There are many more powerful options, refer to the complete list below.
|
||||
Il existe beaucoup d'autres options puissantes, référez-vous à la liste complète
|
||||
ci-dessous.
|
||||
|
||||
.. note::
|
||||
To avoid duplicating launch actions with frequently used parameters, you can
|
||||
use :opt:`action_alias` to define launch action aliases. For example::
|
||||
Pour éviter de dupliquer les actions launch avec des paramètres fréquemment
|
||||
utilisés, vous pouvez utiliser :opt:`action_alias` pour définir des alias
|
||||
d'action launch. Par exemple ::
|
||||
|
||||
action_alias launch_tab launch --cwd=current --type=tab
|
||||
map f1 launch_tab vim
|
||||
map f2 launch_tab emacs
|
||||
|
||||
The :kbd:`F1` key will now open :program:`vim` in a new tab with the current
|
||||
windows working directory.
|
||||
La touche :kbd:`F1` ouvrira désormais :program:`vim` dans un nouvel onglet
|
||||
avec le répertoire de travail de la fenêtre courante.
|
||||
|
||||
|
||||
The piping environment
|
||||
L'environnement du pipe
|
||||
--------------------------
|
||||
|
||||
When using :option:`launch --stdin-source`, the program to which the data is
|
||||
piped has a special environment variable declared, :envvar:`KITTY_PIPE_DATA`
|
||||
whose contents are::
|
||||
Lorsque vous utilisez :option:`launch --stdin-source`, le programme auquel les
|
||||
données sont envoyées dispose d'une variable d'environnement spéciale,
|
||||
:envvar:`KITTY_PIPE_DATA`, dont le contenu est ::
|
||||
|
||||
KITTY_PIPE_DATA={scrolled_by}:{cursor_x},{cursor_y}:{lines},{columns}
|
||||
|
||||
where ``scrolled_by`` is the number of lines kitty is currently scrolled by,
|
||||
``cursor_(x|y)`` is the position of the cursor on the screen with ``(1,1)``
|
||||
being the top left corner and ``{lines},{columns}`` being the number of rows
|
||||
and columns of the screen.
|
||||
où ``scrolled_by`` est le nombre de lignes de défilement actuel de kitty,
|
||||
``cursor_(x|y)`` est la position du curseur à l'écran avec ``(1,1)``
|
||||
correspondant au coin supérieur gauche et ``{lines},{columns}`` étant le nombre
|
||||
de lignes et de colonnes de l'écran.
|
||||
|
||||
|
||||
Special arguments
|
||||
Arguments spéciaux
|
||||
-------------------
|
||||
|
||||
There are a few special placeholder arguments that can be specified as part of
|
||||
the command line:
|
||||
Quelques arguments de remplacement spéciaux peuvent être indiqués dans la ligne
|
||||
de commande :
|
||||
|
||||
|
||||
``@selection``
|
||||
Replaced by the currently selected text.
|
||||
Remplacé par le texte actuellement sélectionné.
|
||||
|
||||
``@active-kitty-window-id``
|
||||
Replaced by the id of the currently active kitty window.
|
||||
Remplacé par l'identifiant de la fenêtre kitty actuellement active.
|
||||
|
||||
``@line-count``
|
||||
Replaced by the number of lines in STDIN. Only present when passing some
|
||||
data to STDIN.
|
||||
Remplacé par le nombre de lignes sur STDIN. Présent uniquement lorsque des
|
||||
données sont passées sur STDIN.
|
||||
|
||||
``@input-line-number``
|
||||
Replaced by the number of lines a pager should scroll to match the current
|
||||
scroll position in kitty. See :opt:`scrollback_pager` for details.
|
||||
Remplacé par le nombre de lignes que le pager doit faire défiler pour
|
||||
correspondre à la position de défilement courante dans kitty. Voir
|
||||
:opt:`scrollback_pager` pour les détails.
|
||||
|
||||
``@scrolled-by``
|
||||
Replaced by the number of lines kitty is currently scrolled by.
|
||||
Remplacé par le nombre de lignes de défilement actuel de kitty.
|
||||
|
||||
``@cursor-x``
|
||||
Replaced by the current cursor x position with 1 being the leftmost cell.
|
||||
Remplacé par la position x courante du curseur, 1 étant la cellule la plus
|
||||
à gauche.
|
||||
|
||||
``@cursor-y``
|
||||
Replaced by the current cursor y position with 1 being the topmost cell.
|
||||
Remplacé par la position y courante du curseur, 1 étant la cellule la plus
|
||||
haute.
|
||||
|
||||
``@first-line-on-screen``
|
||||
Replaced by the first line on screen. Can be used for pager positioning.
|
||||
Remplacé par la première ligne à l'écran. Utilisable pour le positionnement
|
||||
du pager.
|
||||
|
||||
``@last-line-on-screen``
|
||||
Replaced by the last line on screen. Can be used for pager positioning.
|
||||
Remplacé par la dernière ligne à l'écran. Utilisable pour le positionnement
|
||||
du pager.
|
||||
|
||||
|
||||
For example::
|
||||
Par exemple ::
|
||||
|
||||
map f1 launch my-program @active-kitty-window-id
|
||||
|
||||
|
||||
.. _watchers:
|
||||
|
||||
Watching launched windows
|
||||
Surveiller les fenêtres lancées
|
||||
---------------------------
|
||||
|
||||
The :option:`launch --watcher` option allows you to specify Python functions
|
||||
that will be called at specific events, such as when the window is resized or
|
||||
closed. Note that you can also specify watchers that are loaded for all windows,
|
||||
via :opt:`watcher`. To create a watcher, specify the path to a Python module
|
||||
that specifies callback functions for the events you are interested in, for
|
||||
create :file:`~/.config/kitty/mywatcher.py` and use :option:`launch --watcher` = :file:`mywatcher.py`:
|
||||
L'option :option:`launch --watcher` vous permet d'indiquer des fonctions Python
|
||||
qui seront appelées lors d'événements précis, comme le redimensionnement ou la
|
||||
fermeture de la fenêtre. Notez que vous pouvez aussi indiquer des watchers
|
||||
chargés pour toutes les fenêtres, via :opt:`watcher`. Pour créer un watcher,
|
||||
indiquez le chemin d'un module Python qui définit des fonctions de rappel pour
|
||||
les événements qui vous intéressent ; par exemple créez
|
||||
:file:`~/.config/kitty/mywatcher.py` et utilisez :option:`launch --watcher` =
|
||||
:file:`mywatcher.py` :
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -134,110 +145,113 @@ create :file:`~/.config/kitty/mywatcher.py` and use :option:`launch --watcher` =
|
||||
|
||||
|
||||
def on_load(boss: Boss, data: dict[str, Any]) -> None:
|
||||
# This is a special function that is called just once when this watcher
|
||||
# module is first loaded, can be used to perform any initialization/one
|
||||
# time setup. Any exceptions in this function are printed to kitty's
|
||||
# STDERR but otherwise ignored.
|
||||
# Fonction spéciale appelée une seule fois lors du premier chargement de
|
||||
# ce module watcher ; utile pour toute initialisation ou configuration
|
||||
# ponctuelle. Les exceptions levées ici sont affichées sur STDERR de
|
||||
# kitty mais ignorées par ailleurs.
|
||||
...
|
||||
|
||||
def on_resize(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# Here data will contain old_geometry and new_geometry
|
||||
# Note that resize is also called the first time a window is created
|
||||
# which can be detected as old_geometry will have all zero values, in
|
||||
# particular, old_geometry.xnum and old_geometry.ynum will be zero.
|
||||
# Ici data contient old_geometry et new_geometry.
|
||||
# Notez que resize est aussi appelé lors de la première création d'une
|
||||
# fenêtre, ce qui se détecte au fait que old_geometry aura toutes ses
|
||||
# valeurs à zéro, en particulier old_geometry.xnum et old_geometry.ynum
|
||||
# valant zéro.
|
||||
...
|
||||
|
||||
def on_focus_change(boss: Boss, window: Window, data: dict[str, Any])-> None:
|
||||
# Here data will contain focused
|
||||
# Ici data contient focused
|
||||
...
|
||||
|
||||
def on_close(boss: Boss, window: Window, data: dict[str, Any])-> None:
|
||||
# called when window is closed, typically when the program running in
|
||||
# it exits
|
||||
# appelé lorsque la fenêtre est fermée, typiquement quand le programme
|
||||
# qui y tourne se termine
|
||||
...
|
||||
|
||||
def on_set_user_var(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when a "user variable" is set or deleted on a window. Here
|
||||
# data will contain key and value
|
||||
# appelé lorsqu'une « variable utilisateur » est définie ou supprimée sur
|
||||
# une fenêtre. Ici data contient key et value
|
||||
...
|
||||
|
||||
def on_title_change(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when the window title is changed on a window. Here
|
||||
# data will contain title and from_child. from_child will be True
|
||||
# when a title change was requested via escape code from the program
|
||||
# running in the terminal
|
||||
# appelé lorsque le titre d'une fenêtre change. Ici data contient title
|
||||
# et from_child. from_child vaut True lorsque le changement de titre a été
|
||||
# demandé par un code d'échappement du programme qui tourne dans le
|
||||
# terminal
|
||||
...
|
||||
|
||||
def on_cmd_startstop(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when the shell starts/stops executing a command. Here
|
||||
# data will contain is_start, cmdline and time.
|
||||
# appelé lorsque le shell commence ou termine l'exécution d'une commande.
|
||||
# Ici data contient is_start, cmdline et time.
|
||||
...
|
||||
|
||||
def on_program_status_change(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when the program status (OSC 7501) records of the window
|
||||
# change. Here data will contain program_status, the list of current
|
||||
# records, each a dict with keys: id, state, kind, progress, app,
|
||||
# title and msg.
|
||||
# appelé lorsque les enregistrements d'état de programme (OSC 7501) de la
|
||||
# fenêtre changent. Ici data contient program_status, la liste des
|
||||
# enregistrements courants, chacun étant un dict avec les clés : id,
|
||||
# state, kind, progress, app, title et msg.
|
||||
...
|
||||
|
||||
def on_color_scheme_preference_change(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when the color scheme preference of this window changes from
|
||||
# light to dark or vice versa. data contains is_dark and via_escape_code
|
||||
# the latter will be true if the color scheme was changed via escape
|
||||
# code received from the program running in the window
|
||||
# appelé lorsque la préférence de jeu de couleurs de cette fenêtre passe
|
||||
# de clair à sombre ou inversement. data contient is_dark et
|
||||
# via_escape_code, ce dernier valant True si le jeu de couleurs a été
|
||||
# changé par un code d'échappement reçu du programme de la fenêtre
|
||||
...
|
||||
|
||||
def on_tab_bar_dirty(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when any changes happen to the tab bar, such a new tabs being
|
||||
# created, tab titles changing, tabs moving, etc. Useful to display the
|
||||
# tab bar externally to kitty. This is called even if the tab bar is
|
||||
# hidden. Note that this is called only in *global watchers*, that is
|
||||
# watchers defined in kitty.conf or using the --watcher command line
|
||||
# flag. data contains tab_manager which is the object responsible for
|
||||
# managing all tabs in a single OS Window.
|
||||
# appelé lorsque la barre d'onglets change : création d'onglets, changement
|
||||
# de titre, déplacement d'onglets, etc. Utile pour afficher la barre
|
||||
# d'onglets en dehors de kitty. Appelé même si la barre d'onglets est
|
||||
# masquée. Notez que cela n'est appelé que dans les *watchers globaux*,
|
||||
# c'est-à-dire les watchers définis dans kitty.conf ou avec l'option
|
||||
# --watcher. data contient tab_manager, l'objet responsable de la gestion
|
||||
# de tous les onglets d'une même fenêtre OS.
|
||||
...
|
||||
|
||||
def on_quit(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when kitty is about to quit. This is called in *global watchers*
|
||||
# only. It is called twice: once before the quit confirmation dialog is
|
||||
# shown (data['confirmed'] will be False) and once after the user has
|
||||
# confirmed quitting (data['confirmed'] will be True). Setting
|
||||
# data['aborted'] to True will abort the quit in both cases.
|
||||
# appelé lorsque kitty est sur le point de quitter. Appelé uniquement dans
|
||||
# les *watchers globaux*. Appelé deux fois : une fois avant l'affichage de
|
||||
# la boîte de confirmation (data['confirmed'] vaut False) et une fois
|
||||
# après confirmation par l'utilisateur (data['confirmed'] vaut True).
|
||||
# Mettre data['aborted'] à True annule la fermeture dans les deux cas.
|
||||
...
|
||||
|
||||
|
||||
Every callback is passed a reference to the global ``Boss`` object as well as
|
||||
the ``Window`` object the action is occurring on. The ``data`` object is a dict
|
||||
that contains event dependent data. You have full access to kitty internals in
|
||||
the watcher scripts, however kitty internals are not documented/stable so for
|
||||
most things you are better off using the kitty :doc:`Remote control API </remote-control>`.
|
||||
Simply call :code:`boss.call_remote_control()`, with the same arguments you
|
||||
would pass to ``kitten @``. For example:
|
||||
Chaque fonction de rappel reçoit une référence à l'objet global ``Boss`` ainsi
|
||||
qu'à l'objet ``Window`` concerné par l'action. L'objet ``data`` est un dict qui
|
||||
contient les données propres à l'événement. Vous avez un accès complet aux
|
||||
entrailles de kitty dans les scripts watcher, mais elles ne sont ni
|
||||
documentées ni stables ; pour la plupart des besoins, mieux vaut utiliser
|
||||
l':doc:`API de contrôle à distance </remote-control>` de kitty. Appelez
|
||||
simplement :code:`boss.call_remote_control()`, avec les mêmes arguments que
|
||||
vous passeriez à ``kitten @``. Par exemple :
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def on_resize(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# send some text to the resized window
|
||||
# envoie du texte à la fenêtre redimensionnée
|
||||
boss.call_remote_control(window, ('send-text', f'--match=id:{window.id}', 'hello world'))
|
||||
|
||||
Run, ``kitten @ --help`` in a kitty terminal, to see all the remote control
|
||||
commands available to you.
|
||||
Lancez ``kitten @ --help`` dans un terminal kitty pour voir toutes les commandes
|
||||
de contrôle à distance à votre disposition.
|
||||
|
||||
|
||||
Finding executables
|
||||
Recherche des exécutables
|
||||
-----------------------
|
||||
|
||||
When you specify a command to run as just a name rather than an absolute path,
|
||||
it is searched for in the system-wide :envvar:`PATH` environment variable. Note
|
||||
that this **may not** be the value of :envvar:`PATH` inside a shell, as shell
|
||||
startup scripts often change the value of this variable. If it is not found
|
||||
there, then a system specific list of default paths is searched. If it is still
|
||||
not found, then your shell is run and the value of :envvar:`PATH` inside the
|
||||
shell is used.
|
||||
Lorsque vous indiquez une commande à exécuter sous forme de simple nom plutôt
|
||||
que de chemin absolu, elle est recherchée dans la variable d'environnement
|
||||
:envvar:`PATH` du système. Notez que ce **n'est peut-être pas** la valeur de
|
||||
:envvar:`PATH` dans un shell, car les scripts de démarrage du shell modifient
|
||||
souvent cette variable. Si la commande n'y est pas trouvée, une liste de
|
||||
chemins par défaut propre au système est parcourue. Si elle n'est toujours pas
|
||||
trouvée, votre shell est lancé et la valeur de :envvar:`PATH` à l'intérieur du
|
||||
shell est utilisée.
|
||||
|
||||
See :opt:`exe_search_path` for details and how to control this.
|
||||
Voir :opt:`exe_search_path` pour les détails et la façon de contrôler cela.
|
||||
|
||||
Syntax reference
|
||||
Référence de syntaxe
|
||||
------------------
|
||||
|
||||
.. include:: /generated/launch.rst
|
||||
Reference in new issue
Block a user