Go to file
Rafael Kitover 37b27d2eef
Support use as a Windows program outside of Cygwin
If `getenv("SHELL")` is `NULL`, use the function `win32_setenv_shell()`
added to `osdep-win32-cpp.cpp` to set it using the command line of the
parent process, which is retrieved using WMI WIN32 API.

This is a C++ file because the OLE/WMI API is only available for C++.
Adjust the autotools code to add this file and link the necessary
Windows DLLs.

Include some fixed/missing MINGW headers necessary to compile this file.
This will be fixed in the relevant places and they will be removed.

Add a new macro WIN32_PLATFORM for Windows specific functionality, currently
Cygwin and MSYS2, in the future for the native port as well.

When spawning commands using the shell, check for cmd.exe on Windows and
use the `/c` switch, otherwise use `-c` which works for PowerShell,
MSYS2, Cygwin and Git Bash etc..

Adjust code that uses `/tmp/` to use
`$env:USERPROFILE/AppData/Local/Temp/` outside of a Cygwin virtual
filesystem when `/tmp/` is not available, add the function
`win32_get_tmpdir()` and related functions to `osdep-win32.c` for this.

Use `getenv("USERPROFILE")` when `getenv("HOME")` is `NULL`.

When outside of a Cygwin virtual filesystem, use
`C:\ProgramData\tmux\tmux.conf:$USERPROFILE\.tmux.conf:$LOCALAPPDATA\tmux\tmux.conf`
as the config search order.

Use the ncurses term-driver with `TERM="#win32con"` when a terminfo
database is not available. This will require patches to ncurses as well
as MSYS2 and Cygwin to work.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-10-02 16:01:39 +00:00
.github Update lock.yml. 2024-03-06 21:45:26 +00:00
compat Rename header guards on compat/queue.h to avoid it conflicting if the system 2024-08-04 09:57:26 +01:00
fuzz Typo from Bastian Venthur. 2024-09-06 13:09:43 +01:00
logo Icons, from someone on GitHub in issue 2870. 2021-09-10 15:00:58 +01:00
presentations Add a couple of presentations I wrote a few years ago. One for the ill-fated 2015-06-04 08:23:40 +01:00
regress Fix up regression tests. 2024-10-01 13:40:42 +01:00
third_party/mingw_headers Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
tools Merge SIXEL branch. 2023-08-22 08:43:35 +01:00
.gitignore Scaffold for oss-fuzz, from Sergey Nizovtsev. 2020-11-09 16:44:39 +00:00
.mailmap Add to .mailmap. 2016-07-19 10:42:44 +01:00
.travis.yml Add FreeBSD CI, from Jan Beich. 2020-05-19 12:34:34 +01:00
alerts.c Merge branch 'obsd-master' into master 2021-04-12 12:01:32 +01:00
arguments.c Merge branch 'obsd-master' 2024-05-13 14:01:10 +01:00
attributes.c Add an attribute for ACS. 2020-04-23 07:15:17 +01:00
autogen.sh Bump automake and autoconf versions. 2017-03-22 08:45:53 +00:00
cfg.c Merge branch 'obsd-master' 2023-09-15 10:01:11 +01:00
CHANGES tmux 3.5. 2024-09-27 08:56:39 +01:00
client.c Merge branch 'obsd-master' 2024-08-28 10:27:21 +01:00
cmd-attach-session.c Show config errors on attach if they were not shown when the session 2022-07-06 08:40:52 +00:00
cmd-bind-key.c Replace %% in command lists (by copying them) for template arguments , 2021-08-27 17:25:55 +00:00
cmd-break-pane.c Update palette when moving a pane, GitHub issue 3437. 2023-01-17 06:50:55 +00:00
cmd-capture-pane.c Add missing -T to getopt string. 2023-09-01 16:40:38 +00:00
cmd-choose-tree.c When picking a buffer because one isn't specified by the user, ignore 2022-06-04 07:42:07 +00:00
cmd-command-prompt.c Fixes for memory leaks reported by Lu Ming Yin, fixes from Howard Chu. 2024-04-15 08:19:55 +00:00
cmd-confirm-before.c Fix memory leaks reported by Lu Ming Yin. 2024-05-15 08:39:30 +00:00
cmd-copy-mode.c Add copy-mode -d flag to scroll a page down if in copy mode already, 2024-08-26 07:09:34 +00:00
cmd-detach-client.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-display-menu.c Merge branch 'obsd-master' 2024-03-21 14:01:10 +00:00
cmd-display-message.c Extend display-message to work for control clients. GitHub issue 3449. 2023-02-05 21:15:32 +00:00
cmd-display-panes.c Do not notify window-layout-changed if the window is about to be 2024-03-21 11:30:42 +00:00
cmd-find-window.c Only wrap pattern in *s if using a regular expression. 2023-12-27 20:42:01 +00:00
cmd-find.c Merge branch 'obsd-master' 2023-07-10 12:01:12 +01:00
cmd-if-shell.c Add -e flag to set environment for popup, from Alexis Hildebrandt in 2021-10-11 10:55:30 +00:00
cmd-join-pane.c Merge branch 'obsd-master' 2023-01-17 10:01:09 +00:00
cmd-kill-pane.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-kill-server.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-kill-session.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-kill-window.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-list-buffers.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-list-clients.c Add -f to list-clients like the other list commands, from Andy Walker in 2023-02-06 09:20:30 +00:00
cmd-list-keys.c Support -1 without -N for list-keys. 2023-01-17 10:40:51 +00:00
cmd-list-panes.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-list-sessions.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-list-windows.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-load-buffer.c If an application gives the first parameter to OSC 52, validate and pass 2022-06-09 09:12:55 +00:00
cmd-lock-server.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-move-window.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-new-session.c Show config errors on attach if they were not shown when the session 2022-07-06 08:40:52 +00:00
cmd-new-window.c Expand name before looking for window with -S, GitHub issue 3670. 2023-09-01 14:24:46 +00:00
cmd-parse.y Make a little effort to treate CRLF as LF in config files. GitHub issue 2024-08-04 09:42:23 +00:00
cmd-paste-buffer.c Merge branch 'obsd-master' 2024-02-13 10:01:10 +00:00
cmd-pipe-pane.c Merge branch 'obsd-master' 2024-02-13 10:01:10 +00:00
cmd-queue.c Merge branch 'obsd-master' 2024-05-14 12:01:09 +01:00
cmd-refresh-client.c Add a way (refresh-client -r) for control mode clients to provide OSC 10 2024-06-24 08:30:50 +00:00
cmd-rename-session.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-rename-window.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-resize-pane.c Do not notify window-layout-changed if the window is about to be 2024-03-21 11:30:42 +00:00
cmd-resize-window.c Get rid of some warnings with GCC 10, from Thomas Klausner. 2023-06-30 13:19:32 +00:00
cmd-respawn-pane.c Replace %% in command lists (by copying them) for template arguments , 2021-08-27 17:25:55 +00:00
cmd-respawn-window.c Replace %% in command lists (by copying them) for template arguments , 2021-08-27 17:25:55 +00:00
cmd-rotate-window.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-run-shell.c Restore previous behaviour or writing to stdout if available. 2024-05-14 07:33:01 +00:00
cmd-save-buffer.c Merge branch 'obsd-master' 2022-12-07 12:01:09 +00:00
cmd-select-layout.c Better error reporting when applying custom layouts. 2022-05-30 12:52:02 +00:00
cmd-select-pane.c Use a stack for last panes line windows, from Thomas Bertschinger in 2023-07-10 09:24:53 +00:00
cmd-select-window.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-send-keys.c Change pasting to bypass the output key processing entirely and write 2024-10-01 06:15:47 +00:00
cmd-server-access.c Add a missing space. 2022-05-31 16:13:43 +00:00
cmd-set-buffer.c If an application gives the first parameter to OSC 52, validate and pass 2022-06-09 09:12:55 +00:00
cmd-set-environment.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-set-option.c Validate command argument types (string or command list) and give more 2021-08-25 08:51:55 +00:00
cmd-show-environment.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-show-messages.c Merge branch 'obsd-master' into master 2021-08-21 12:01:41 +01:00
cmd-show-options.c Do not return error with -q, GitHub issue 3065. 2022-04-06 14:19:49 +01:00
cmd-show-prompt-history.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-source-file.c Merge branch 'obsd-master' 2023-09-15 10:01:11 +01:00
cmd-split-window.c Merge branch 'obsd-master' 2024-03-07 00:01:10 +00:00
cmd-swap-pane.c Use a stack for last panes line windows, from Thomas Bertschinger in 2023-07-10 09:24:53 +00:00
cmd-swap-window.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-switch-client.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-unbind-key.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd-wait-for.c Add args parsing callback for some future work, currently unused. 2021-08-21 10:22:38 +00:00
cmd.c Merge branch 'obsd-master' 2024-05-18 12:01:09 +01:00
colour.c Fix grey colour, from Magnus Gross. 2024-09-29 20:05:42 +00:00
compat.h Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
configure.ac Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
control-notify.c Add paste-buffer-deleted notification and fix name of paste-buffer-changed. 2022-10-28 13:00:02 +00:00
control.c Merge branch 'obsd-master' 2022-08-24 10:01:13 +01:00
COPYING There is no examples directory anymore. 2019-03-26 15:10:05 +00:00
environ.c If built with systemd, remove some environment variables it uses. From Ciprian 2024-08-04 09:58:13 +01:00
example_tmux.conf Use terminal-features instead of terminal-overrides to enable truecolor support 2024-08-04 09:59:18 +01:00
file.c Merge branch 'obsd-master' 2023-04-27 19:16:08 +01:00
format-draw.c Add a session, pane and user mouse range types for the status line and 2023-08-17 14:10:28 +00:00
format.c Merge branch 'obsd-master' 2024-08-28 10:27:21 +01:00
grid-reader.c back-to-indentation fixes, from Anindya Mukherjee. 2021-06-10 09:20:42 +01:00
grid-view.c Add a -T flag to capture-pane to stop at the last used cell instead of 2022-09-28 07:55:29 +00:00
grid.c Check the underline style colour against the correct default value again 2024-06-24 08:11:46 +00:00
hyperlinks.c Merge branch 'obsd-master' 2024-08-28 10:27:21 +01:00
image-sixel.c Fix crash if SIXEL colour register is invalid and remove SIXEL images before 2024-03-21 11:37:09 +00:00
image.c Merge SIXEL branch. 2023-08-22 08:43:35 +01:00
input-keys.c Merge branch 'obsd-master' 2024-10-02 10:01:08 +01:00
input.c Merge branch 'obsd-master' 2024-09-17 00:01:09 +01:00
job.c Merge branch 'obsd-master' 2024-09-30 12:01:11 +01:00
key-bindings.c Add mirrored versions of the main-horizontal and main-vertical layouts where 2024-08-21 05:03:13 +00:00
key-string.c Ignore internal function keys if they have not got an entry in the key 2024-08-23 13:25:39 +00:00
layout-custom.c Fixes for memory leaks reported by Lu Ming Yin, fixes from Howard Chu. 2024-04-15 08:19:55 +00:00
layout-set.c Check for exact match for layout name before looking for a prefix match. 2024-08-23 10:19:06 +00:00
layout.c Add split-window -Z to start the pane zoomed, GitHub issue 2591. 2021-03-11 06:31:05 +00:00
log.c Spacing/style nits. 2022-05-30 12:55:25 +00:00
Makefile.am Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
mdoc2man.awk Generate tmux.1 using mdoc2man.awk on Solaris, issue brought up and changes 2013-04-16 11:33:53 +01:00
menu.c Revamp extended keys support to more closely match xterm and support 2024-08-21 04:17:09 +00:00
mode-tree.c Add a way to make the preview larger in tree mode, GitHub issue 4124. 2024-10-01 10:10:29 +00:00
names.c Remove stray spaces after function names. 2021-08-20 17:50:42 +00:00
notify.c Merge branch 'obsd-master' 2023-06-30 16:01:10 +01:00
options-table.c Merge branch 'obsd-master' 2024-10-02 14:01:10 +01:00
options.c Expand full array option values if no index is provided, GitHub issue 2024-07-22 15:27:42 +00:00
osdep-aix.c Update my email address. 2016-01-19 18:07:25 +00:00
osdep-cygwin.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-darwin.c +compat.h 2021-01-17 17:52:10 +00:00
osdep-dragonfly.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-freebsd.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-haiku.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-hpux.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-linux.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-netbsd.c Remove unnecessary declarations. 2022-04-06 14:19:50 +01:00
osdep-openbsd.c Use PATH_MAX instead of MAXPATHLEN. 2022-04-06 14:19:50 +01:00
osdep-sunos.c Looks like evports on SunOS are broken also, disable them. GitHub issue 2702. 2021-06-10 09:23:03 +01:00
osdep-unknown.c Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
osdep-win32-cpp.cpp Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
osdep-win32.c Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
paste.c Merge branch 'obsd-master' 2023-02-07 14:01:11 +00:00
popup.c Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
proc.c Merge branch 'obsd-master' 2024-02-13 10:01:10 +00:00
README OS X -> macOS, from J Lewis Muir. 2021-11-11 09:18:04 +00:00
README.ja OS X -> macOS, from J Lewis Muir. 2021-11-11 09:18:04 +00:00
regsub.c Change a few types to fix warnings, from Thomas Klausner. 2023-06-30 21:55:08 +00:00
resize.c Do not notify window-layout-changed if the window is about to be 2024-03-21 11:30:42 +00:00
screen-redraw.c Merge branch 'obsd-master' 2024-08-28 10:27:21 +01:00
screen-write.c Merge branch 'obsd-master' 2024-08-21 08:01:09 +01:00
screen.c Merge branch 'obsd-master' 2024-10-01 10:01:10 +01:00
server-acl.c Spacing/style nits. 2022-05-30 12:55:25 +00:00
server-client.c Set client stdout file descriptor also for Cgywin, from Michael Wild via Rafael 2024-10-02 12:16:24 +01:00
server-fn.c Merge branch 'obsd-master' 2024-04-05 02:01:09 +01:00
server.c Merge branch 'obsd-master' 2024-08-28 10:27:21 +01:00
session.c Merge branch 'obsd-master' 2024-10-01 10:01:10 +01:00
spawn.c Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
status.c Clear overlay when command prompt is entered. Also fix some spacing in 2024-08-22 09:05:51 +00:00
style.c Use strtonum instead of atoi. 2024-08-26 13:02:15 +00:00
SYNCING Minor cleanups, GitHub issue 2824. 2021-08-14 18:39:56 +01:00
tmux-protocol.h If a pane is killed, cancel reading from the file. GitHub issue 3422. 2023-01-06 07:09:27 +00:00
tmux.1 Merge branch 'obsd-master' 2024-10-01 14:01:08 +01:00
tmux.c Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
tmux.h Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
tty-acs.c Fix a couple of rounded border characters, from Alexis Hildebrandt. 2023-08-08 07:19:48 +00:00
tty-features.c Merge branch 'obsd-master' 2024-08-21 08:01:09 +01:00
tty-keys.c Change pasting to bypass the output key processing entirely and write 2024-10-01 06:15:47 +00:00
tty-term.c Support use as a Windows program outside of Cygwin 2024-10-02 16:01:39 +00:00
tty.c Merge branch 'obsd-master' 2024-09-30 12:01:11 +01:00
utf8-combined.c Change UTF-8 combining to inspect the previous character at the cursor 2023-09-15 15:49:05 +00:00
utf8.c utf8proc bits for utf8_fromwc. 2024-07-12 14:30:56 +01:00
window-buffer.c Merge branch 'obsd-master' 2024-08-04 12:01:09 +01:00
window-client.c Extend the menu drawing function to support custom characters and 2023-08-08 07:41:04 +00:00
window-clock.c Do not hoke into struct window_pane from the tty code and instead set 2020-05-01 17:01:36 +01:00
window-copy.c Use global cursor style and colour options for modes instead of default, 2024-10-01 08:01:19 +00:00
window-customize.c Add unit (milliseconds) to escape-time, show unset colours as "none" 2022-04-06 14:19:51 +01:00
window-tree.c Merge branch 'obsd-master' 2023-07-01 02:01:10 +01:00
window.c Merge branch 'obsd-master' 2024-10-01 10:01:10 +01:00
xmalloc.c Add xrecallocarray. 2019-11-28 09:51:58 +00:00
xmalloc.h Merge branch 'obsd-master' into master 2021-08-25 10:01:10 +01:00

Welcome to tmux!

tmux is a terminal multiplexer: it enables a number of terminals to be created,
accessed, and controlled from a single screen. tmux may be detached from a
screen and continue running in the background, then later reattached.

This release runs on OpenBSD, FreeBSD, NetBSD, Linux, macOS and Solaris.

* Dependencies

tmux depends on libevent 2.x, available from:

	https://github.com/libevent/libevent/releases/latest

It also depends on ncurses, available from:

	https://invisible-mirror.net/archives/ncurses/

To build tmux, a C compiler (for example gcc or clang), make, pkg-config and a
suitable yacc (yacc or bison) are needed.

* Installation

To build and install tmux from a release tarball, use:

	$ ./configure && make
	$ sudo make install

tmux can use the utempter library to update utmp(5), if it is installed - run
configure with --enable-utempter to enable this.

To get and build the latest from version control - note that this requires
autoconf, automake and pkg-config:

	$ git clone https://github.com/tmux/tmux.git
	$ cd tmux
	$ sh autogen.sh
	$ ./configure && make

* Contributing

Bug reports, feature suggestions and especially code contributions are most
welcome. Please send by email to:

	tmux-users@googlegroups.com

Or open a GitHub issue or pull request.

* Documentation

For documentation on using tmux, see the tmux.1 manpage. View it from the
source tree with:

	$ nroff -mdoc tmux.1|less

A small example configuration is in example_tmux.conf.

Other documentation is available in the wiki:

	https://github.com/tmux/tmux/wiki

Also see the tmux FAQ at:

	https://github.com/tmux/tmux/wiki/FAQ

A bash(1) completion file is at:

	https://github.com/imomaliev/tmux-bash-completion

For debugging, run tmux with -v and -vv to generate server and client log files
in the current directory.

* Support

The tmux mailing list for general discussion and bug reports is:

	https://groups.google.com/forum/#!forum/tmux-users

Subscribe by sending an email to:

	tmux-users+subscribe@googlegroups.com

* License

This file and the CHANGES files are licensed under the ISC license. All other
files have a license and copyright notice at their start.