Compare commits

...

5 Commits

Author SHA1 Message Date
Lumynous ac034146af
Merge 419b465075 into c18d7941ef 2024-05-09 20:11:49 +05:30
dundargoc c18d7941ef build: allow sccache as compiler cache
Also enable caching for dependencies.

Closes https://github.com/neovim/neovim/issues/28670
2024-05-09 16:39:45 +02:00
lumynou5 419b465075
fix(terminal): report winszie in pixels as 0 if it's not a TTY
Window sizes in pixels now have a fallback value 0 when NeoVim is not
running in a TTY.  This prevents NeoVim from crashing if it's running in
an IDE's integrated terminal, a terminal multiplexer, or a testing, etc.
2024-05-07 16:17:27 +08:00
lumynou5 83a63c24f6
refactor: add parentheses for readability
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-05-03 18:40:14 +08:00
lumynou5 ab50ab3268
fix(terminal): report terminal window size in pixels
Window size in pixels is required by some programs, reporting it can
help those programs work inside NeoVim terminals.

See also: #8259, #12991
2024-05-03 17:51:58 +08:00
3 changed files with 26 additions and 8 deletions

View File

@ -50,11 +50,6 @@ file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}")
find_program(CCACHE_PRG ccache)
if(CCACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
endif()
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()

View File

@ -23,6 +23,12 @@ if(POLICY CMP0092)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
endif()
find_program(CACHE_PRG NAMES ccache sccache)
if(CACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
endif()
# MAKE_PRG
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
@ -58,7 +64,8 @@ function(get_externalproject_options name DEPS_IGNORE_SHA)
set(EXTERNALPROJECT_OPTIONS
DOWNLOAD_NO_PROGRESS TRUE
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL})
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if(NOT ${DEPS_IGNORE_SHA})
list(APPEND EXTERNALPROJECT_OPTIONS URL_HASH SHA256=${${name_allcaps}_SHA256})

View File

@ -171,7 +171,17 @@ int pty_process_spawn(PtyProcess *ptyproc)
Process *proc = (Process *)ptyproc;
assert(proc->err.closed);
uv_signal_start(&proc->loop->children_watcher, chld_handler, SIGCHLD);
ptyproc->winsize = (struct winsize){ ptyproc->height, ptyproc->width, 0, 0 };
if (isatty(1)) {
ioctl(1, TIOCGWINSZ, &ptyproc->winsize);
ptyproc->winsize = (struct winsize){
ptyproc->height,
ptyproc->width,
(ptyproc->winsize.ws_xpixel / ptyproc->winsize.ws_col) * ptyproc->width,
(ptyproc->winsize.ws_ypixel / ptyproc->winsize.ws_row) * ptyproc->height,
};
} else {
ptyproc->winsize = (struct winsize){ ptyproc->height, ptyproc->width, 0, 0 };
}
uv_disable_stdio_inheritance();
int master;
int pid = forkpty(&master, NULL, &termios_default, &ptyproc->winsize);
@ -232,7 +242,13 @@ const char *pty_process_tty_name(PtyProcess *ptyproc)
void pty_process_resize(PtyProcess *ptyproc, uint16_t width, uint16_t height)
FUNC_ATTR_NONNULL_ALL
{
ptyproc->winsize = (struct winsize){ height, width, 0, 0 };
ioctl(ptyproc->tty_fd, TIOCGWINSZ, &ptyproc->winsize);
ptyproc->winsize = (struct winsize){
height,
width,
(ptyproc->winsize.ws_xpixel / ptyproc->winsize.ws_col) * width,
(ptyproc->winsize.ws_ypixel / ptyproc->winsize.ws_row) * height,
};
ioctl(ptyproc->tty_fd, TIOCSWINSZ, &ptyproc->winsize);
}