Commit Graph

73 Commits

Author SHA1 Message Date
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
269dab4b3e Merge branch 'obsd-master' 2023-07-10 12:01:12 +01:00
8b3e2eab5a Use a stack for last panes line windows, from Thomas Bertschinger in
GitHub issue 3588.
2023-07-10 09:24:53 +00:00
e4c4ceb286 Merge branch 'obsd-master' 2023-07-10 02:01:11 +01:00
b7e22d00b4 Call closefrom after removing signals because newer libevent doesn't
like its signal fd being closed Azat Khuzhin.
2023-07-09 22:54:52 +00:00
b9524f5b72 Add support for spawning panes in separate cgroups with systemd and a configure
flag to disable. From Eric T Johnson yut23 AT gvljohnsons DOT com in GitHub
issue 3514.
2023-04-03 08:54:06 +01:00
9abf5d9fe5 Merge branch 'obsd-master' 2022-08-10 18:01:11 +01:00
273577ba0a Fix check of home directory (&& not ||), from Markus F X J Oberhumer,
GitHub issue 3297.
2022-08-10 14:03:59 +00:00
6a5d210e55 Set PWD so shells have a hint about the real path (this was done before
but lost in a merge). GitHub issue 3186.
2022-05-30 13:06:41 +00:00
95baa32383 Set PWD so shells have a hint about the real path (this was done before but
lost in a merge). GitHub issue 3186.
2022-05-20 08:33:57 +01:00
95a374d7d2 Merge branch 'obsd-master' into master 2021-08-23 16:06:46 +01:00
4a753dbefc Fix a few memory leaks. 2021-08-23 11:04:21 +00:00
12cfd0d22b Merge branch 'obsd-master' into master 2021-03-11 08:01:29 +00:00
d98f9f7fe5 Add split-window -Z to start the pane zoomed, GitHub issue 2591. 2021-03-11 06:31:05 +00:00
2301bee87d Merge branch 'obsd-master' into master 2021-03-02 12:01:25 +00:00
81f9a23d25 Do not use NULL active window; also do not leak window name. GitHub
issue 2590 from Chester Liu.
2021-03-02 11:00:38 +00:00
c44750792a Drop support for popups where the content is provided directly to tmux
(which does not have many practical uses) and only support running a
program in the popup. display-popup is now simpler and can accept
multiple arguments to avoid escaping problems (like the other commands).
2021-03-02 10:56:45 +00:00
742e670805 Merge branch 'obsd-master' into master 2021-02-19 10:01:19 +00:00
b04f8acb70 Check return value of chdir() to stop a silly warning with some
compilers, GitHub issue 2573.
2021-02-19 09:09:16 +00:00
fd4d3e8793 Set IUTF8 again when it exists. 2020-05-26 06:15:57 +01:00
2420bd8584 spawn.c: fix up bad merge 2020-05-21 09:02:36 +01:00
31e3f2d530 Support code for control mode flow control: allow clients to have
separate offsets (used and acknowleged) into the pane buffers; turn off
reading from panes when no clients can accept the data; and add a -A
flag to refresh-client to let clients turn receiving a pane on and off.
2020-05-21 07:24:13 +00:00
303d342d5f Add a client flag 'active-pane' which stores the active pane in the
client and allows it to be changed independently from the real active
pane stored in the window. This is can be used with session groups which
allow an independent current window (although it would be nice to have a
flag for this too and remove session groups). The client active pane is
only really useful interactively, many things (hooks, window-style,
zooming) still use the window active pane.
2020-05-16 16:20:59 +00:00
0bdbf47ef9 Add a client flag 'active-pane' which stores the active pane in the client and
allows it to be changed independently from the real active pane stored in the
window. This is can be used with session groups which allow an independent
current window (although it would be nice to have a flag for this too and
remove session groups). The client active pane is only really useful
interactively, many things (hooks, window-style, zooming) still use the window
active pane.
2020-05-14 11:18:19 +01:00
e94a15b3d6 Merge branch 'obsd-master' 2020-04-23 10:01:26 +01:00
906dfe9f5c Fix a couple of memory leaks, one when creating a new pane and one when
adding formats onto the queue item.
2020-04-23 05:48:42 +00:00
653a159225 Merge branch 'obsd-master' 2020-04-14 00:01:41 +01:00
3f7f9a0e20 Make client -c and -t handling common in cmd-queue.c and try to be
clearer about whether the client is the target client (must have a
session) or not.
2020-04-13 20:51:57 +00:00
8f2b5d714a Merge branch 'obsd-master' 2020-04-13 14:01:45 +01:00
04cdd03525 Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its
use more clearly defined and preparation for some future work).
2020-04-13 10:59:58 +00:00
dfd29977e0 Merge branch 'obsd-master' 2020-03-31 20:01:34 +01:00
cc8b41f294 Add a way to mark environment variables as "hidden" so they can be used
by tmux but are not passed into the environment of new panes.
2020-03-31 17:14:40 +00:00
c9cd8f9b5d Merge branch 'obsd-master' 2020-03-31 10:01:29 +01:00
eedf059d00 Detach reply escape sequences from the pane so they work in popups. 2020-03-31 06:35:38 +00:00
35c4897d8f Merge branch 'obsd-master' 2020-03-19 16:01:29 +00:00
de34436d4c Change input path so it doesn't require a pane. 2020-03-19 14:03:48 +00:00
0610f66fa9 Merge branch 'obsd-master' 2020-03-17 12:01:28 +00:00
115bb33257 Ignore default-shell (and use /bin/sh) if it invalid not just if it is
tmux itself, also refuse to set the option to something invalid in the
first place. GitHub issue 2120.
2020-03-17 11:10:12 +00:00
ccd24c9cb2 Merge branch 'obsd-master' 2020-03-02 23:09:48 +00:00
8be179de46 Use current session for cwd of new sessions, not the new session which
doesn't have one yet. GitHub issue 2091.
2020-03-02 08:30:30 +00:00
ee3d3db364 Merge branch 'obsd-master' 2020-01-28 11:17:08 +00:00
32816eaebd Set up working directory before killing the existing pane on respawn. 2020-01-28 10:21:21 +00:00
7110226b96 Merge branch 'obsd-master' 2020-01-02 00:01:29 +00:00
9cc603cbad Fix format expansion in window names, reported by Suraj N Kurapati. 2020-01-01 21:51:33 +00:00
54efe33799 Add back utempter code, reported by Peter Schellenbach. 2019-12-18 15:58:06 +00:00
5f5f029e3b Merge branch 'obsd-master' 2019-11-28 12:18:41 +00:00
2349b1dbef Make a best effort to set xpixel and ypixel for each pane and add
formats for them.
2019-11-28 09:45:15 +00:00
518a687886 Merge branch 'obsd-master' 2019-11-14 10:01:29 +00:00
08b07b1a08 Add an option to set the key sent by backspace for those whose system
uses ^H rather than ^?. GitHub issue 1969.
2019-11-14 07:55:01 +00:00
7323ffeef2 Merge branch 'obsd-master' 2019-10-07 10:01:24 +01:00