mirror of
https://github.com/tmux/tmux.git
synced 2025-12-17 00:02:23 -05:00
Merge branch 'tmux:master' into feature-floating-window-panes
This commit is contained in:
commit
5df5217e2e
213
CHANGES
213
CHANGES
@ -1,3 +1,216 @@
|
|||||||
|
CHANGES FROM 3.5a TO 3.6
|
||||||
|
|
||||||
|
* Add seconds options for clock mode (issue 4697).
|
||||||
|
|
||||||
|
* Add a resize callback for menus so that they are correctly moved on resize
|
||||||
|
(issue 4696).
|
||||||
|
|
||||||
|
* Make -v to source-file pass through to subsequent source-file commands (issue
|
||||||
|
4216).
|
||||||
|
|
||||||
|
* If display-popup is used inside a popup, modify that popup (issue 4678).
|
||||||
|
|
||||||
|
* Add selection-mode command to expilcitly set the selection mode in copy mode
|
||||||
|
(issue 3842).
|
||||||
|
|
||||||
|
* Save and restore images in alternate screen (issue 3732).
|
||||||
|
|
||||||
|
* Ignore Hangul filler character (issue 3998).
|
||||||
|
|
||||||
|
* Improve handling of regional indicators and emoji modifiers (issue 3998).
|
||||||
|
|
||||||
|
* Preserve marked pane with swap-window and move-window (issue 3443).
|
||||||
|
|
||||||
|
* Set and check COLORTERM as a hint for RGB colour.
|
||||||
|
|
||||||
|
* If tmux receives a palette request (OSC 4) in a pane and the palette entry
|
||||||
|
has not been set, send a request to the most recently used client and
|
||||||
|
forward any response instead (based on change from Tim Culverhouse, issue
|
||||||
|
4665).
|
||||||
|
|
||||||
|
* Add -l flag to command-prompt to disable splitting into multiple prompts
|
||||||
|
(issue 4483).
|
||||||
|
|
||||||
|
* Don't enter copy mode on mouse wheel in alternate screen (issue 3705).
|
||||||
|
|
||||||
|
* Add commands to centre the cursor in copy mode (issue 4662).
|
||||||
|
|
||||||
|
* Support case insensitive search in modes in the same way as copy mode
|
||||||
|
(like emacs, so all-lowercase means case insensitive) (issue 4396).
|
||||||
|
|
||||||
|
* Fix the logic of the no-detached case for the detach-on-destroy option (from
|
||||||
|
Martin Louazel, issue 4649).
|
||||||
|
|
||||||
|
* Add buffer_full format variable (from Mohammad AlSaleh, issue 4630).
|
||||||
|
|
||||||
|
* Introduce a new window option, tiled-layout-max-columns, which configures the
|
||||||
|
maximum number of columns in the tiled layout.
|
||||||
|
|
||||||
|
* Add support for DECRQSS SP q (report cursor style), DECRQM ?12 (report cursor
|
||||||
|
blink state) and DECRQM ?2004, ?1004, ?1006 (report mouse state) ( rom
|
||||||
|
Andrea Alberti, issue 4618).
|
||||||
|
|
||||||
|
* Fix missing argument from OSC 4 reply (issue 4596).
|
||||||
|
|
||||||
|
* Add -k flag to display-popup which allows any key to dismiss the popup once
|
||||||
|
the command has exited (from Meriel Luna Mittelbach, issue 4612).
|
||||||
|
|
||||||
|
* Add nicer default second and third status lines (from Michael Grant, issue
|
||||||
|
4490).
|
||||||
|
|
||||||
|
* Add a pane-border-lines "spaces" value to use spaces for pane borders (issue
|
||||||
|
4587).
|
||||||
|
|
||||||
|
* Replace invalid UTF-8 characters with the placeholder instead of ignoring
|
||||||
|
them (issue 4514).
|
||||||
|
|
||||||
|
* Fix incorrect handling of Korean Hangul Jamo characters (from Roy Jung, issue
|
||||||
|
4546).
|
||||||
|
|
||||||
|
* Allow uppercase letters in gray/grey color names (from Pavel Roskin, issue
|
||||||
|
4560).
|
||||||
|
|
||||||
|
* Add sorting to W, P, L loop operators (from Michael Grant, issue 4516).
|
||||||
|
|
||||||
|
* Detect support for OSC 52 using the device attributes report (from James
|
||||||
|
Holderness, issue 4539).
|
||||||
|
|
||||||
|
* Add noattr for styles and use in mode-style to allow whether attributes are
|
||||||
|
ignored or used to be configured (issue 4498).
|
||||||
|
|
||||||
|
* Add a set-default style attribute which replaces the current default colours
|
||||||
|
and attributes completely.
|
||||||
|
|
||||||
|
* Add -E to run-shell to forward stderr as well as stdout (issue 4246).
|
||||||
|
|
||||||
|
* Add an option variation-selector-always-wide to instruct tmux not to
|
||||||
|
always interpret VS16 as a wide character and assume the terminal does
|
||||||
|
likewise.
|
||||||
|
|
||||||
|
* Switch to getopt_long from OpenSSH (from Koichi Murase, issue 4492).
|
||||||
|
|
||||||
|
* Add more features for boolean expressions in formats: 1) extend && and || to
|
||||||
|
support arbitrarily many arguments and 2) add ! and !! for not and not-not
|
||||||
|
(from David Mandelberg).
|
||||||
|
|
||||||
|
* Do not mistake other DCS sequences for SIXEL sequences (from James
|
||||||
|
Holderness, issue 4488).
|
||||||
|
|
||||||
|
* Improve #? conditional expression in formats: add support for else if and
|
||||||
|
default empty string if no else value (from David Mandelberg, issue 4451).
|
||||||
|
|
||||||
|
* Add default-client-command to set the command used if tmux is run without a
|
||||||
|
command; the default stays new-session (from David Mandelberg, issue
|
||||||
|
4422).
|
||||||
|
|
||||||
|
* Add S-Up and S-Down to move windows in tree mode (from David Mandelberg,
|
||||||
|
issue 4415).
|
||||||
|
|
||||||
|
* Add mode 2031 support to automatically report dark or light theme. tmux will
|
||||||
|
guess the theme from the background colour on terminals which do not
|
||||||
|
themselves support the escape sequence (from Jonathan Slenders, issue 4353).
|
||||||
|
|
||||||
|
* Add -M flag to capture-pane to use the copy mode screen (issue 4358).
|
||||||
|
|
||||||
|
* Align index numbers in trees (from David Mandelberg, issue 4360).
|
||||||
|
|
||||||
|
* Add display-message -C flag to update pane while message is displayed (from
|
||||||
|
Vitaly Ostrosablin, issue 4363).
|
||||||
|
|
||||||
|
* Make list-commands command show only one command if an argument is given
|
||||||
|
(from Ilya Grigoriev, issue 4352).
|
||||||
|
|
||||||
|
* Count line numbers correctly inside strings in configuration files (reported
|
||||||
|
by Pedro Navarro, issue 4325).
|
||||||
|
|
||||||
|
* Map bright black (colour 8) to white (7) if the background is black on
|
||||||
|
terminals with only eight colours so the text is not invisible (from Dmytro
|
||||||
|
Bagrii, issue 4322).
|
||||||
|
|
||||||
|
* New codepoint-widths option allowing users to override the width of
|
||||||
|
individual Unicode codepoints.
|
||||||
|
|
||||||
|
* Add a nesting limit to source-file (from Fadi Afani, issue 4223).
|
||||||
|
|
||||||
|
* Add copy-mode-position-style and copy-mode-selection-style options for copy
|
||||||
|
mode.
|
||||||
|
|
||||||
|
* Add no-detach-on-destroy client option (issue 4242).
|
||||||
|
|
||||||
|
* Add input-buffer-size option (from Ken Lau).
|
||||||
|
|
||||||
|
* Add support for a scrollbar at the side of each pane. New options
|
||||||
|
pane-scrollbars turn them on or off, pane-scrollbars-position sets the
|
||||||
|
position (left or right), and pane-scrollbars-style to set the colours (from
|
||||||
|
Michael Grant, issue 4221).
|
||||||
|
|
||||||
|
* Allow control characters to be entered at the command prompt by prefixing
|
||||||
|
with C-v (from Alexander Arch, issue 4206).
|
||||||
|
|
||||||
|
* Do not attempt to search for zero length strings (from Alexander Arch, issue
|
||||||
|
4209).
|
||||||
|
|
||||||
|
* Preserve tabs for copying and capture-pane (from Alexander Arch, issue
|
||||||
|
4201).
|
||||||
|
|
||||||
|
* Increase the maximum for repeat-time.
|
||||||
|
|
||||||
|
* Adjust how Ctrl and Meta keys are sent to use standard representation if
|
||||||
|
available in mode 1 (from Stanislav Kljuhhin, issue 4188).
|
||||||
|
|
||||||
|
* Allow attributes in menu style (from Japin Li, issue 4194).
|
||||||
|
|
||||||
|
* Add a sixel_support format variable which is 1 if SIXEL is supported, always
|
||||||
|
0 on OpenBSD (requested by Misaki Masa, issue 4177).
|
||||||
|
|
||||||
|
* Add prompt-cursor-colour and prompt-cursor-style to set the style of the
|
||||||
|
cursor in the command prompt and remove the emulated cursor (from Alexander
|
||||||
|
Arch, issue 4170).
|
||||||
|
|
||||||
|
* Add initial-repeat-time option to allow the first repeat time to be increased
|
||||||
|
and later reduced (from David le Blanc, issue 4164).
|
||||||
|
|
||||||
|
* Send focus events to pane when entering or leaving popup (issue 3991).
|
||||||
|
|
||||||
|
* Add copy-mode-position-format to configure the position indicator.
|
||||||
|
|
||||||
|
* Add -y flag to disable confirmation prompts in modes (issue 4152).
|
||||||
|
|
||||||
|
* Add -C and -P flags to the copy commands in copy mode: -C prevents the
|
||||||
|
commands from sending the text to the clipboard and -P prevents them from
|
||||||
|
adding the text as a paste buffer (issue 4153).
|
||||||
|
|
||||||
|
* Preserve transparency and raster attribute dimensions when sending a SIXEL
|
||||||
|
image, and avoid collapsing empty lines (issue 4149).
|
||||||
|
|
||||||
|
* Bypass permission check for Cygwin (based on a change by Yuya Adachi via
|
||||||
|
Rafael Kitover, issue 4148).
|
||||||
|
|
||||||
|
* Add MSYSTEM to default update-environment (for Cgywin).
|
||||||
|
|
||||||
|
* Set client stdout file descriptor also for Cgywin (from Michael Wild via Rafael
|
||||||
|
Kitover, issue 4148).
|
||||||
|
|
||||||
|
* Use global cursor style and colour options for modes instead of default
|
||||||
|
(issue 4117).
|
||||||
|
|
||||||
|
* Fix pasting so it does not interpret keys but instead copies the input
|
||||||
|
without interpretation (reported by Mark Kelly).
|
||||||
|
|
||||||
|
* Try to query window pixel size from the outside terminal if the values
|
||||||
|
returned by TIOCGWINSZ are zero (Dmitry Galchinsky, issue 4099).
|
||||||
|
|
||||||
|
CHANGES FROM 3.5 TO 3.5a
|
||||||
|
|
||||||
|
* Do not translate BSpace as Unicode with extended keys.
|
||||||
|
|
||||||
|
* Fix so that keys with Shift are represented correctly with extended keys.
|
||||||
|
|
||||||
|
* Revert to using /bin/sh for #() and run-shell and if-shell; the change to use
|
||||||
|
default-shell only applies now to popups.
|
||||||
|
|
||||||
|
* Fix grey colour without a number suffix in styles.
|
||||||
|
|
||||||
CHANGES FROM 3.4 TO 3.5
|
CHANGES FROM 3.4 TO 3.5
|
||||||
|
|
||||||
* Revamp extended keys support to more closely match xterm and support mode 2
|
* Revamp extended keys support to more closely match xterm and support mode 2
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# configure.ac
|
# configure.ac
|
||||||
|
|
||||||
AC_INIT([tmux], next-3.6)
|
AC_INIT([tmux], next-3.7)
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR(etc)
|
AC_CONFIG_AUX_DIR(etc)
|
||||||
|
|||||||
34
menu.c
34
menu.c
@ -438,6 +438,38 @@ chosen:
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
menu_resize_cb(struct client *c, void *data)
|
||||||
|
{
|
||||||
|
struct menu_data *md = data;
|
||||||
|
u_int nx, ny, w, h;
|
||||||
|
|
||||||
|
if (md == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
nx = md->px;
|
||||||
|
ny = md->py;
|
||||||
|
|
||||||
|
w = md->menu->width + 4;
|
||||||
|
h = md->menu->count + 2;
|
||||||
|
|
||||||
|
if (nx + w > c->tty.sx) {
|
||||||
|
if (c->tty.sx <= w)
|
||||||
|
nx = 0;
|
||||||
|
else
|
||||||
|
nx = c->tty.sx - w;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ny + h > c->tty.sy) {
|
||||||
|
if (c->tty.sy <= h)
|
||||||
|
ny = 0;
|
||||||
|
else
|
||||||
|
ny = c->tty.sy - h;
|
||||||
|
}
|
||||||
|
md->px = nx;
|
||||||
|
md->py = ny;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
menu_set_style(struct client *c, struct grid_cell *gc, const char *style,
|
menu_set_style(struct client *c, struct grid_cell *gc, const char *style,
|
||||||
const char *option)
|
const char *option)
|
||||||
@ -551,6 +583,6 @@ menu_display(struct menu *menu, int flags, int starting_choice,
|
|||||||
if (md == NULL)
|
if (md == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
server_client_set_overlay(c, 0, NULL, menu_mode_cb, menu_draw_cb,
|
server_client_set_overlay(c, 0, NULL, menu_mode_cb, menu_draw_cb,
|
||||||
menu_key_cb, menu_free_cb, NULL, md);
|
menu_key_cb, menu_free_cb, menu_resize_cb, md);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ static const char *options_table_mode_keys_list[] = {
|
|||||||
"emacs", "vi", NULL
|
"emacs", "vi", NULL
|
||||||
};
|
};
|
||||||
static const char *options_table_clock_mode_style_list[] = {
|
static const char *options_table_clock_mode_style_list[] = {
|
||||||
"12", "24", NULL
|
"12", "24", "12-with-seconds", "24-with-seconds", NULL
|
||||||
};
|
};
|
||||||
static const char *options_table_status_list[] = {
|
static const char *options_table_status_list[] = {
|
||||||
"off", "on", "2", "3", "4", "5", NULL
|
"off", "on", "2", "3", "4", "5", NULL
|
||||||
|
|||||||
@ -2933,8 +2933,8 @@ server_client_reset_state(struct client *c)
|
|||||||
struct window_pane *wp = server_client_get_pane(c), *loop;
|
struct window_pane *wp = server_client_get_pane(c), *loop;
|
||||||
struct screen *s = NULL;
|
struct screen *s = NULL;
|
||||||
struct options *oo = c->session->options;
|
struct options *oo = c->session->options;
|
||||||
int mode = 0, cursor, flags, n;
|
int mode = 0, cursor, flags;
|
||||||
u_int cx = 0, cy = 0, ox, oy, sx, sy;
|
u_int cx = 0, cy = 0, ox, oy, sx, sy, n;
|
||||||
|
|
||||||
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
|
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
|
||||||
return;
|
return;
|
||||||
@ -2966,13 +2966,13 @@ server_client_reset_state(struct client *c)
|
|||||||
if (c->prompt_string != NULL) {
|
if (c->prompt_string != NULL) {
|
||||||
n = options_get_number(oo, "status-position");
|
n = options_get_number(oo, "status-position");
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
cy = 0;
|
cy = status_prompt_line_at(c);
|
||||||
else {
|
else {
|
||||||
n = status_line_size(c);
|
n = status_line_size(c) - status_prompt_line_at(c);
|
||||||
if (n == 0)
|
if (n <= tty->sy)
|
||||||
cy = tty->sy - 1;
|
|
||||||
else
|
|
||||||
cy = tty->sy - n;
|
cy = tty->sy - n;
|
||||||
|
else
|
||||||
|
cy = tty->sy - 1;
|
||||||
}
|
}
|
||||||
cx = c->prompt_cursor;
|
cx = c->prompt_cursor;
|
||||||
} else if (c->overlay_draw == NULL) {
|
} else if (c->overlay_draw == NULL) {
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|||||||
13
status.c
13
status.c
@ -264,14 +264,19 @@ status_line_size(struct client *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get the prompt line number for client's session. 1 means at the bottom. */
|
/* Get the prompt line number for client's session. 1 means at the bottom. */
|
||||||
static u_int
|
u_int
|
||||||
status_prompt_line_at(struct client *c)
|
status_prompt_line_at(struct client *c)
|
||||||
{
|
{
|
||||||
struct session *s = c->session;
|
struct session *s = c->session;
|
||||||
|
u_int line, lines;
|
||||||
|
|
||||||
if (c->flags & (CLIENT_STATUSOFF|CLIENT_CONTROL))
|
lines = status_line_size(c);
|
||||||
return (1);
|
if (lines == 0)
|
||||||
return (options_get_number(s->options, "message-line"));
|
return (0);
|
||||||
|
line = options_get_number(s->options, "message-line");
|
||||||
|
if (line >= lines)
|
||||||
|
return (lines - 1);
|
||||||
|
return (line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get window at window list position. */
|
/* Get window at window list position. */
|
||||||
|
|||||||
2
tmux.1
2
tmux.1
@ -4927,7 +4927,7 @@ option is enabled.
|
|||||||
Set clock colour.
|
Set clock colour.
|
||||||
.Pp
|
.Pp
|
||||||
.It Xo Ic clock-mode-style
|
.It Xo Ic clock-mode-style
|
||||||
.Op Ic 12 | 24
|
.Op Ic 12 | 24 | 12-with-seconds | 24-with-seconds
|
||||||
.Xc
|
.Xc
|
||||||
Set clock hour format.
|
Set clock hour format.
|
||||||
.Pp
|
.Pp
|
||||||
|
|||||||
1
tmux.h
1
tmux.h
@ -2961,6 +2961,7 @@ extern u_int status_prompt_hsize[];
|
|||||||
void status_timer_start(struct client *);
|
void status_timer_start(struct client *);
|
||||||
void status_timer_start_all(void);
|
void status_timer_start_all(void);
|
||||||
void status_update_cache(struct session *);
|
void status_update_cache(struct session *);
|
||||||
|
u_int status_prompt_line_at(struct client *);
|
||||||
int status_at_line(struct client *);
|
int status_at_line(struct client *);
|
||||||
u_int status_line_size(struct client *);
|
u_int status_line_size(struct client *);
|
||||||
struct style_range *status_get_range(struct client *, u_int, u_int);
|
struct style_range *status_get_range(struct client *, u_int, u_int);
|
||||||
|
|||||||
7
tty.c
7
tty.c
@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
static int tty_log_fd = -1;
|
static int tty_log_fd = -1;
|
||||||
|
|
||||||
|
static void tty_start_timer_callback(int, short, void *);
|
||||||
|
static void tty_clipboard_query_callback(int, short, void *);
|
||||||
static void tty_set_italics(struct tty *);
|
static void tty_set_italics(struct tty *);
|
||||||
static int tty_try_colour(struct tty *, int, const char *);
|
static int tty_try_colour(struct tty *, int, const char *);
|
||||||
static void tty_force_cursor_colour(struct tty *, int);
|
static void tty_force_cursor_colour(struct tty *, int);
|
||||||
@ -296,6 +298,8 @@ tty_open(struct tty *tty, char **cause)
|
|||||||
if (tty->out == NULL)
|
if (tty->out == NULL)
|
||||||
fatal("out of memory");
|
fatal("out of memory");
|
||||||
|
|
||||||
|
evtimer_set(&tty->clipboard_timer, tty_clipboard_query_callback, tty);
|
||||||
|
evtimer_set(&tty->start_timer, tty_start_timer_callback, tty);
|
||||||
evtimer_set(&tty->timer, tty_timer_callback, tty);
|
evtimer_set(&tty->timer, tty_timer_callback, tty);
|
||||||
|
|
||||||
tty_start_tty(tty);
|
tty_start_tty(tty);
|
||||||
@ -327,7 +331,6 @@ tty_start_start_timer(struct tty *tty)
|
|||||||
|
|
||||||
log_debug("%s: start timer started", c->name);
|
log_debug("%s: start timer started", c->name);
|
||||||
evtimer_del(&tty->start_timer);
|
evtimer_del(&tty->start_timer);
|
||||||
evtimer_set(&tty->start_timer, tty_start_timer_callback, tty);
|
|
||||||
evtimer_add(&tty->start_timer, &tv);
|
evtimer_add(&tty->start_timer, &tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,6 +448,7 @@ tty_stop_tty(struct tty *tty)
|
|||||||
tty->flags &= ~TTY_STARTED;
|
tty->flags &= ~TTY_STARTED;
|
||||||
|
|
||||||
evtimer_del(&tty->start_timer);
|
evtimer_del(&tty->start_timer);
|
||||||
|
evtimer_del(&tty->clipboard_timer);
|
||||||
|
|
||||||
event_del(&tty->timer);
|
event_del(&tty->timer);
|
||||||
tty->flags &= ~TTY_BLOCK;
|
tty->flags &= ~TTY_BLOCK;
|
||||||
@ -3316,6 +3320,5 @@ tty_clipboard_query(struct tty *tty)
|
|||||||
tty_putcode_ss(tty, TTYC_MS, "", "?");
|
tty_putcode_ss(tty, TTYC_MS, "", "?");
|
||||||
|
|
||||||
tty->flags |= TTY_OSC52QUERY;
|
tty->flags |= TTY_OSC52QUERY;
|
||||||
evtimer_set(&tty->clipboard_timer, tty_clipboard_query_callback, tty);
|
|
||||||
evtimer_add(&tty->clipboard_timer, &tv);
|
evtimer_add(&tty->clipboard_timer, &tv);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,7 +142,7 @@ window_clock_timer_callback(__unused int fd, __unused short events, void *arg)
|
|||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
gmtime_r(&t, &now);
|
gmtime_r(&t, &now);
|
||||||
gmtime_r(&data->tim, &then);
|
gmtime_r(&data->tim, &then);
|
||||||
if (now.tm_min == then.tm_min)
|
if (now.tm_sec == then.tm_sec)
|
||||||
return;
|
return;
|
||||||
data->tim = t;
|
data->tim = t;
|
||||||
|
|
||||||
@ -212,6 +212,7 @@ window_clock_draw_screen(struct window_mode_entry *wme)
|
|||||||
struct screen *s = &data->screen;
|
struct screen *s = &data->screen;
|
||||||
struct grid_cell gc;
|
struct grid_cell gc;
|
||||||
char tim[64], *ptr;
|
char tim[64], *ptr;
|
||||||
|
const char *timeformat;
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
u_int i, j, x, y, idx;
|
u_int i, j, x, y, idx;
|
||||||
@ -223,14 +224,23 @@ window_clock_draw_screen(struct window_mode_entry *wme)
|
|||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
if (style == 0) {
|
if (style == 0 || style == 2) {
|
||||||
strftime(tim, sizeof tim, "%l:%M ", localtime(&t));
|
if (style == 2)
|
||||||
|
timeformat = "%l:%M:%S ";
|
||||||
|
else
|
||||||
|
timeformat = "%l:%M ";
|
||||||
|
strftime(tim, sizeof tim, timeformat, localtime(&t));
|
||||||
if (tm->tm_hour >= 12)
|
if (tm->tm_hour >= 12)
|
||||||
strlcat(tim, "PM", sizeof tim);
|
strlcat(tim, "PM", sizeof tim);
|
||||||
else
|
else
|
||||||
strlcat(tim, "AM", sizeof tim);
|
strlcat(tim, "AM", sizeof tim);
|
||||||
} else
|
} else {
|
||||||
strftime(tim, sizeof tim, "%H:%M", tm);
|
if (style == 3)
|
||||||
|
timeformat = "%H:%M:%S";
|
||||||
|
else
|
||||||
|
timeformat = "%H:%M";
|
||||||
|
strftime(tim, sizeof tim, timeformat, tm);
|
||||||
|
}
|
||||||
|
|
||||||
screen_write_clearscreen(&ctx, 8);
|
screen_write_clearscreen(&ctx, 8);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user