dvtm

Fork of dvtm, a minimal terminal multiplexer
git clone git://git.laack.co/dvtm.git
Log | Files | Refs | README | LICENSE

README.md (12279B)


      1 # dvtm - dynamic virtual terminal manager
      2 
      3 [dvtm](https://www.brain-dump.org/projects/dvtm/) brings the concept
      4 of tiling window management, popularized by X11-window managers like
      5 [dwm](https://dwm.suckless.org) to the console. As a console window
      6 manager it tries to make it easy to work with multiple console based
      7 programs.
      8 
      9 ![abduco+dvtm demo](https://raw.githubusercontent.com/martanne/dvtm/gh-pages/screencast.gif#center)
     10 
     11 ## News
     12 
     13 - [dvtm-0.15](https://www.brain-dump.org/projects/dvtm/dvtm-0.15.tar.gz)
     14   [released](https://lists.suckless.org/dev/1601/28095.html) (09.01.2016)
     15 - [dvtm-0.14](https://www.brain-dump.org/projects/dvtm/dvtm-0.14.tar.gz)
     16   [released](https://lists.suckless.org/dev/1502/25558.html) (19.02.2015)
     17 - [dvtm-0.13](https://www.brain-dump.org/projects/dvtm/dvtm-0.13.tar.gz)
     18   [released](https://lists.suckless.org/dev/1411/24449.html) (15.11.2014)
     19 - [dvtm-0.12](https://www.brain-dump.org/projects/dvtm/dvtm-0.12.tar.gz)
     20   [released](https://lists.suckless.org/dev/1407/22702.html) (05.07.2014)
     21 - [dvtm-0.11](https://www.brain-dump.org/projects/dvtm/dvtm-0.11.tar.gz)
     22   [released](https://lists.suckless.org/dev/1403/20371.html) (08.03.2014)
     23 - [dvtm-0.10](https://www.brain-dump.org/projects/dvtm/dvtm-0.10.tar.gz)
     24   [released](https://lists.suckless.org/dev/1312/18805.html) (28.12.2013)
     25 - [dvtm-0.9](https://www.brain-dump.org/projects/dvtm/dvtm-0.9.tar.gz)
     26   [released](https://lists.suckless.org/dev/1304/15112.html) (3.04.2013)
     27 - [dvtm-0.8](https://www.brain-dump.org/projects/dvtm/dvtm-0.8.tar.gz)
     28   [released](https://lists.suckless.org/dev/1208/12004.html) (1.08.2012)
     29 - [dvtm-0.7](https://www.brain-dump.org/projects/dvtm/dvtm-0.7.tar.gz)
     30   [released](https://lists.suckless.org/dev/1109/9266.html) (4.09.2011)
     31 - [dvtm-0.6](https://www.brain-dump.org/projects/dvtm/dvtm-0.6.tar.gz)
     32   [released](https://lists.suckless.org/dev/1010/6146.html) (8.10.2010)
     33 - [dvtm-0.5.2](https://www.brain-dump.org/projects/dvtm/dvtm-0.5.2.tar.gz)
     34   [released](https://lists.suckless.org/dev/0907/0520.html) (7.07.2009)
     35 - [dvtm-0.5.1](https://www.brain-dump.org/projects/dvtm/dvtm-0.5.1.tar.gz)
     36   [released](https://lists.suckless.org/dwm/0902/7405.html) (8.02.2009)
     37 - [dvtm-0.5](https://www.brain-dump.org/projects/dvtm/dvtm-0.5.tar.gz)
     38   [released](https://lists.suckless.org/dwm/0901/7354.html) (26.01.2009)
     39 - [dvtm-0.4.1](https://www.brain-dump.org/projects/dvtm/dvtm-0.4.1.tar.gz)
     40   [released](https://lists.suckless.org/dwm/0805/5672.html) (10.05.2008)
     41 - [dvtm-0.4](https://www.brain-dump.org/projects/dvtm/dvtm-0.4.tar.gz)
     42   [released](https://lists.suckless.org/dwm/0802/4850.html) (17.02.2008)
     43 - [dvtm-0.3](https://www.brain-dump.org/projects/dvtm/dvtm-0.3.tar.gz)
     44   [released](https://lists.suckless.org/dwm/0801/4735.html) (12.01.2008)
     45 - [dvtm-0.2](https://www.brain-dump.org/projects/dvtm/dvtm-0.2.tar.gz)
     46   [released](https://lists.suckless.org/dwm/0712/4677.html) (29.12.2007)
     47 - [dvtm-0.1](https://www.brain-dump.org/projects/dvtm/dvtm-0.1.tar.gz)
     48   [released](https://lists.suckless.org/dwm/0712/4632.html) (21.12.2007)
     49 - [dvtm-0.01](https://www.brain-dump.org/projects/dvtm/dvtm-0.01.tar.gz)
     50   [released](https://lists.suckless.org/dwm/0712/4424.html) (08.12.2007)
     51 
     52 ## Download
     53 
     54 Either Download the latest [source tarball](https://github.com/martanne/dvtm/releases),
     55 compile (you will need curses headers) and install it
     56 
     57     $EDITOR config.mk && $EDITOR config.def.h && make && sudo make install
     58 
     59 or use one of the distribution provided
     60 [binary packages](https://repology.org/project/dvtm/packages).
     61 
     62 ## Why dvtm? The philosophy behind
     63 
     64 dvtm strives to adhere to the
     65 [Unix philosophy](http://www.catb.org/esr/writings/taoup/html/ch01s06.html).
     66 It tries to do one thing, *dynamic* window management on the console,
     67 and to do it well.
     68 
     69 As such dvtm does *not* implement [session management](#faq) but instead
     70 delegates this task to a separate tool called
     71 [abduco](https://www.brain-dump.org/projects/abduco/).
     72 
     73 Similarly dvtm's copy mode is implemented by piping the scroll back buffer
     74 content to an external editor and only storing whatever the editor writes
     75 to `stdout`. Hence the selection process is delegated to the editor
     76 where powerful features such as regular expression search are available.
     77 
     78 As a result dvtm's source code is relatively small
     79 ([~4000 lines of C](https://www.ohloh.net/p/dvtm/analyses/latest/languages_summary)),
     80 simple and therefore easy to hack on.
     81 
     82 ## Quickstart
     83 
     84 All of dvtm keybindings start with a common modifier which from now
     85 on is refered to as `MOD`. By default `MOD` is set to `CTRL+g` however
     86 this can be changed at runttime with the `-m` command line option.
     87 For example setting `MOD` to `CTRL-b` is accomplished by starting
     88 `dvtm -m ^b`.
     89 
     90 ### Windows
     91 
     92 New windows are created with `MOD+c` and closed with `MOD+x`.
     93 To switch among the windows use `MOD+j` and `MOD+k` or `MOD+[1..9]`
     94 where the digit corresponds to the window number which is displayed
     95 in the title bar. Windows can be minimized and restored with `MOD+.`.
     96 Input can be directed to all visible window by pressing `MOD+a`,
     97 issuing the same key combination again restores normal behaviour
     98 i.e. only the currently focused window will receive input.
     99 
    100 ### Layouts
    101 
    102 Visible Windows are arranged by a layout. Each layout consists of a
    103 master and a tile area. Typically the master area occupies the largest
    104 part of the screen and is intended for the currently most important
    105 window. The size of the master area can be shrunk with `MOD+h`
    106 and enlarged with `MOD-l` respectively. Windows can be zoomed into
    107 the master area with `MOD+Enter`. The number of windows in the
    108 master area can be increased and decreased with `MOD+i` and `MOD+d`.
    109 
    110 By default dvtm comes with 4 different layouts which can be cycled
    111 through via `MOD+Space`
    112 
    113  * vertical stack: master area on the left half, other clients
    114    stacked on the right
    115  * bottom stack: master area on the top half, other clients stacked below
    116  * grid: every window gets an equally sized portion of the screen
    117  * fullscreen: only the selected window is shown and occupies the
    118    whole available display area `MOD+m`
    119 
    120 Further layouts are included in the source tarball but disabled by
    121 default.
    122 
    123 ### Tagging
    124 
    125 Each window has a non empty set of tags [1..n] associated with it. A view
    126 consists of a number of tags. The current view includes all windows
    127 which are tagged with the currently active tags. The following key
    128 bindings are used to manipulate the tagsets.
    129 
    130 - `MOD-0`  view all windows with any tag
    131 - `Mod-v-Tab` toggles to the previously selected tags
    132 - `MOD-v-[1..n]` view all windows with nth tag
    133 - `Mod-V-[1..n]` add/remove all windows with nth tag to/from the view
    134 - `Mod-t-[1..n]` apply nth tag to focused window
    135 - `Mod-T-[1..n]` add/remove nth tag to/from focused window
    136 
    137 ### Statusbar
    138 
    139 dvtm can be instructed to read and display status messages from a named
    140 pipe. As an example the
    141 [`dvtm-status` script](https://raw.githubusercontent.com/martanne/dvtm/master/dvtm-status)
    142 is provided which shows the current time.
    143 
    144 ### Copymode ###
    145 
    146 `MOD+e` pipes the whole scroll buffer content to an external editor.
    147 What ever the editor writes to `stdout` is remembered by dvtm and can
    148 later be pasted with `MOD+p`.
    149 
    150 In order for this to work the editor needs to be usable as a filter
    151 and should use `stderr` for its user interface. Examples where this is
    152 the case include `sandy(1)` and [vis](https://www.brain-dump.org/projects/vis).
    153 
    154     $ echo Hello World | vis - | cat
    155 
    156 ## Patches
    157 
    158 There exist a number of out of tree patches which customize dvtm's
    159 behaviour:
    160 
    161  - [pertag](http://waxandwane.org/dvtm.html) (see also the corresponding
    162    [mailing list post](https://lists.suckless.org/hackers/1510/8186.html))
    163 
    164 ## FAQ
    165 
    166 ### Detach / reattach functionality
    167 
    168 dvtm doesn't have session support built in. Use
    169 [abduco](https://www.brain-dump.org/projects/abduco/) instead.
    170 
    171     $ abduco -c dvtm-session
    172 
    173 Detach using `CTRL-\` and later reattach with
    174 
    175     $ abduco -a dvtm-session
    176 
    177 ### Copy / Paste does not work under X
    178 
    179 If you have mouse support enabled, which is the case with the
    180 default settings, you need to hold down shift while selecting
    181 and inserting text. In case you don't like this behaviour either
    182 run dvtm with the `-M` command line argument, disable it at run
    183 time with `MOD+M` or modify `config.def.h` to disable it completely
    184 at compile time. You will however no longer be able to perform
    185 other mouse actions like selecting windows etc.
    186 
    187 ### How to change the key bindings?
    188 
    189 The configuration of dvtm is done by creating a custom `config.h`
    190 and (re)compiling the source code. See the default `config.def.h`
    191 as an example, adapting it to your preference should be straightforward.
    192 You basically define a set of layouts and keys which dvtm will use.
    193 There are some pre defined macros to ease configuration.
    194 
    195 ### WARNING: terminal is not fully functional
    196 
    197 This means you haven't installed the `dvtm.info` terminfo description
    198 which can be done with `tic -s dvtm.info`. If for some reason you
    199 can't install new terminfo descriptions set the `DVTM_TERM` environment
    200 variable to a known terminal when starting `dvtm` as in
    201 
    202     $ DVTM_TERM=rxvt dvtm
    203 
    204 This will instruct dvtm to use rxvt as `$TERM` value within its windows.
    205 
    206 ### How to set the window title?
    207 
    208 The window title can be changed by means of a
    209 [xterm extension](https://tldp.org/HOWTO/Xterm-Title-3.html#ss3.2)
    210 terminal escape sequence
    211 
    212     $ echo -ne "\033]0;Your title here\007"
    213 
    214 So for example in `bash` if you want to display the current working
    215 directory in the window title this can be accomplished by means of
    216 the following section in your startup files.
    217 
    218     # If this is an xterm set the title to user@host:dir
    219     case "$TERM" in
    220     dvtm*|xterm*|rxvt*)
    221         PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    222         ;;
    223     *)
    224         ;;
    225     esac
    226 
    227 Other shells provide similar functionality, zsh as an example has a
    228 [precmd function](http://zsh.sourceforge.net/Doc/Release/Functions.html#Hook-Functions)
    229 which can be used to achieve the same effect.
    230 
    231 ### Something is wrong with the displayed colors
    232 
    233 Make sure you have set `$TERM` correctly for example if you want to
    234 use 256 color profiles you probably have to append `-256color` to
    235 your regular terminal name. Also due to limitations of ncurses by
    236 default you can only use 255 color pairs simultaneously. If you
    237 need more than 255 different color pairs at the same time, then you
    238 have to rebuild ncurses with
    239 
    240     $ ./configure ... --enable-ext-colors
    241 
    242 Note that this changes the ABI and therefore sets SONAME of the
    243 library to 6 (i.e. you have to link against `libncursesw.so.6`).
    244 
    245 ### Some characters are displayed like garbage
    246 
    247 Make sure you compiled dvtm against a unicode aware curses library
    248 (in case of ncurses this would be `libncursesw`). Also make sure
    249 that your locale settings contain UTF-8.
    250 
    251 ### The numeric keypad does not work with Putty
    252 
    253 Disable [application keypad mode](https://the.earth.li/~sgtatham/putty/0.64/htmldoc/Chapter4.html#config-features-application)
    254 in the Putty configuration under `Terminal => Features => Disable application keypad mode`.
    255 
    256 ### Unicode characters do not work within Putty
    257 
    258 You have to tell Putty in which
    259 [character encoding](https://the.earth.li/~sgtatham/putty/0.64/htmldoc/Chapter4.html#config-translation)
    260 the received data is. Set the dropdown box under `Window => Translation`
    261 to UTF-8. In order to get proper line drawing characters you proabably
    262 also want to set the TERM environment variable to `putty` or `putty-256color`.
    263 If that still doesn't do the trick then try running dvtm with the
    264 following ncurses related environment variable set `NCURSES_NO_UTF8_ACS=1`.
    265 
    266 ## Development
    267 
    268 You can always fetch the current code base from the git repository
    269 located at [Github](https://github.com/martanne/dvtm/) or
    270 [Sourcehut](https://git.sr.ht/~martanne/dvtm).
    271 
    272 If you have comments, suggestions, ideas, a bug report, a patch or
    273 something else related to dvtm then write to the
    274 [suckless developer mailing list](https://suckless.org/community)
    275 or contact me directly.
    276 
    277 ## License
    278 
    279 dvtm reuses some code of dwm and is released under the same
    280 [MIT/X11 license](https://raw.githubusercontent.com/martanne/dvtm/master/LICENSE).
    281 The terminal emulation part is licensed under the ISC license.