-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[RFC] Windows :terminal support #6383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you rebase this on master? |
Some conflicts but the rebase works away that merge commit, see f877eb6 |
How can I remove it. I'm sorry I was not used to git etc. |
To remove the commits do:
If you don't have an editor configured yet, check out this stackoverflow Now change the word |
Thank you brcolow. |
Or origin/master |
I tried it, but this time 8f0aa5d has disappeared. I thought about going back with git reflog, but once I deleted all the local files, it does not remain. May I do as follows
|
With your current branch, just do |
I tried it, but it becomes as follows.
I created another branch and tried I am sorry for taking care of it. |
This works. |
What if you start vim as follows?
I finished this work for now. |
The vim colors issue was bogus, same issue happens in normal cmd.exe (I didn't think to check there because I normally run a different version of vim there, not the old git-for-windows vim). Thanks for working on this! |
There are many points that do not follow the coding guide. I'll fix them. Please remove RFC label temporarily. |
@erw7 Labels are managed by bot, based on the PR title. |
src/nvim/os/pty_process_win.c
Outdated
@@ -102,6 +107,7 @@ int pty_process_spawn(PtyProcess *ptyproc) | |||
NULL, // Optional environment variables | |||
&err); | |||
if (spawncfg == NULL) { | |||
write_winpty_elog("Faied winpty_spawn_config_new.", &status, &err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
src/nvim/os/pty_process_win.c
Outdated
FUNC_ATTR_NONNULL_ALL | ||
{ | ||
PtyProcess *ptyproc = | ||
(PtyProcess *)((uv_handle_t *)wait_eof_timer->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't cast void *
pointers, instead just:
PtyProcess *ptyproc = wait_eof_timer->data;
DWORD dwProcessId; | ||
GetWindowThreadProcessId(consoleWnd, &dwProcessId); | ||
return GetCurrentProcessId() == dwProcessId; | ||
// XXX: We need to make proper detect owns tty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this planned for this PR, or later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not plan on this PR.
I do not understand what to check here on Windows.
test/functional/fixtures/tty-test.c
Outdated
|
||
for (int i = 0; i < cnt; i++) { | ||
if (buf->base[i] == 3) { | ||
(*interrupted)++; | ||
} else if (buf->base[i] == 17) { | ||
prsz = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a comment mentioning where 17 comes from? Or make it a #define
.
src/nvim/CMakeLists.txt
Outdated
@@ -118,6 +118,10 @@ endforeach() | |||
|
|||
list(REMOVE_ITEM NVIM_SOURCES ${to_remove}) | |||
|
|||
if (NOT WIN32) | |||
list(REMOVE_ITEM NVIM_HEADERS "${PROJECT_SOURCE_DIR}/src/nvim/os/pty_process_win.h") | |||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now it fails the "single includes" test. Addressed that in 90de721
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed "single include" test as you say.
Will you work #7007 after this? Then I close this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handling of process exit is still broken. It detects the moment when the child process exits, then quickly stops polling for process output. It should continue polling for output until the agent has scraped all of the process' output. This problem is easy to noticed by running a command like "dir && exit", but even typing "exit<ENTER>" can manifest the problem -- the "t" might not appear. winpty's Cygwin adapter handles shutdown by waiting for the agent to close the CONOUT pipe, which it does after it has scraped the child's last output. AFAIK, neovim doesn't do anything interesting when winpty closes the CONOUT pipe.
Changing to make sure that proc->in, proc-> is not NULL, because nvim crashed when starting a job with pty. Changing to make sure that proc->out is not NULL, because nvim crashed when stopping a job opened with pty.
Remove pty_process_win.h from NVIM_HEADERS on *nix.
tty-test.exe causes abnormal termination with low repeatability, try changing it so as not to use SIGWINCH.
This reverts commit 73b2477.
Implementation based on the work of equalsraf. Changes from the equalsraf work are as follows.
We do not think that the place to quote the command line is optimal, so we need to consider it.
If the last sleep of tty-test.c is enabled, the following error occurs in the functionaltest.
In the case of Windows, I disabled it, is it really necessary to sleep for 100 seconds even in other environments?
At the moment there are the following problems.
Nvim will crash in the next step.nvim-qt.exe -- -u NONE:terminal:qThere is no problem in the case of the following step.nvim.exe -u NONEnvim-qt.exe --server \\.\pipe\nvim-xxxx-0:terminal:qIn this case the errorlevel is also 0.In the following procedure E301: Oops, lost the swap file !!! error will occur.nvim-qt.exe -- -u NONE:e test:call termopen("dir")