Open
Description
Steps to reproduce
- For debugging purposes, create a C file called
winsize.c
, it will be used to get the size of the terminal. Then compile the above C file, e.g.gcc winsize.c -o winsize.out
#include <stdio.h> #include <unistd.h> #include <sys/ioctl.h> int main() { struct winsize size; int err = ioctl(STDOUT_FILENO, TIOCGWINSZ, &size); printf("Error: %d, Columns: %d, Rows: %d\n", err, size.ws_col, size.ws_row); return 0; }
- Launch Vim, run a job with PTY and width of 80 columns. The job uses
winsize.out
to obtain the PTY's sizelet g:out = [] let opts = {'pty': 1, 'env': {'TERM': getenv('TERM'), 'COLUMNS': 80}, 'out_cb': {c, m -> add(g:out, m)}} let job = job_start(['./winsize.out'], opts) while ch_status(job) !=# 'closed' | execute 'sleep 5m' | endwhile echomsg g:out
- Observe the output. In my case, this is
['Error: 0, Columns: 0, Rows: 0']
Expected behaviour
I would expect the COLUMNS
environment variable to set the job PTY's width, as suggested in :help terminal-unix
. When I run ./winsize.out
in a :terminal
, I get something like
Error: 0, Columns: 238, Rows: 27
Version of Vim
9.0.720
Environment
- Operating system: Fedora Linux, kernel 5.19.16-200
- Terminal: Tmux
- Value of $TERM:
tmux-256color
- Shell: ZSH
Logs and stack traces
No response