cygwin + console2 ctrl-c keyboard interrupt not working - console

I'm using console2 as my shell for cygwin and control-C is not working.
I have made sure that control-C is not being used as a hotkey in my console2 settings.
This is how I run cygwin from console2
D:\Programs\Cygwin\bin\bash.exe --login -i
To check for yourself, do
ping google.com -t and try to interrupt it with control C.
Here is my console2 console.xml file, http://pastebin.com/mZ3yHe6D

This was a bug in cygwin, it should be fixed in the upcoming cygwin release (1.7.17), see here
Update: 1.7.17 was released on Oct 20, 2012. The problem is indeed fixed now.

So I was running into this issue through the Git Msys install (utilizes MingW32) on Windows too.
The problem was Ctrl + C was bound to the Copy Selection which negates the ability to pass the Ctrl + C interrupt into the actual console. Reassigning that hotkey binding allows you to actually use Ctrl + C again for interrupting server tasks, etc.

In Console2, reassign the Hotkey Ctrl + C to other, then the termination will work.
Thanks Silva

Instead of reassigning the hotkeys you can also simply press Ctrl-Shift-C for keyboard interruption in Console2

Related

Cursor keys dont work in vim when running zsh on wsl through cmder or conemu

I'm running ubuntu 1804 on windows using the WSL. Everything is set up fine and works correctly. I've also installed ZSH and oh-my-zsh, again this is all good and everything looks like its working fine. Everything except the arrow keys whilst using vim or man pages or some other command line tools.
The up and down keys work on the command line when scrolling through history and also for select commands like nano. Also if I boot into bash rather than zsh the arrow keys do work in vim and man pages, in fact they work everywhere.
If i boot into bash, then switch to zsh on the command line manually the arrow keys then work everywhere.
So my cmder config for zsh
c:/_distros/ubuntu1804/ubuntu1804.exe -c zsh -cur_console:pm
and for bash
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt
The one for bash uses the conemu-cyg-64.exe program that comes from conemu which is a symbiont of POSIX enabled pty and WinAPI full-featured terminal.
Apparently you can use this tool with zsh but i cant manage to make it work i get the error
{PID:10592} failed to run shell (2): No such file or directory
{PID:10592} shell: `/usr/bin/zsh` `-l` `-i`
{PID:10592} dir: `/cygdrive/c/Program Files/cmder`
ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...
and this is the task in cmder
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe /usr/bin/zsh -l -i -cur_console:pm:/mnt
So I think that if i can boot into zsh using conemu-cyg-64 that the cursor keys will probably work in commands like vim and the man pages. Any help or advice getting that working would be brilliant.
EDIT:
On my ubuntu install zsh is installed at /usr/bin/zsh, but there is no file or folder /cygdrive/c/Program Files/cmder
Many thanks to #Maximus for pointing me in the right direction. The answer was right under my nose at the bash on windows page of conemu. A small change to the command i was using before. the zsh needs to go on the end rather than before the --wsl.
The correct task to ensure that cursor keys work on all apps in the terminal is:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pnm:/mnt -t zsh -l

ConEmu + zsh: how will keyboard shortcuts and other shell features work?

I'm trying to wrap my head around this: on Windows, I use cmder (a wrapper around ConEmu) which improves on the bare cmd.exe experience (a lot) but can also host other shells like PowerShell or Git Bash. I'd like to go more "unix-y" but still well integrated with my Windows tools. Git Bash strikes the right balance for me: I can do things like rm -rf node_modules but still run my Windows commands fine.
It's easy to get Git Bash going inside cmder, however, I'd like to replace the shell with zhs, mainly to get the super-useful "up arrow respects the current prefix" feature (I write git, press the up arrow and only get suggestions on the recent Git commands).
The question is, who will handle the up arrow? Will it be ConEmu and do Windows-y stuff (cycling through all the commands) or will it fall down to zsh and the cycling will be implemented by it? How does this work?
Related: ConEmu: possible to change the up arrow behavior?
ConEmu's disclaimer states
ConEmu is not a shell, so it does not provide "shell features" like remote access, tab-completion, command history and others.
Only the shell itself knows when user types a command and only the shell may store executed commands history. Of course, only the shell may process Up/Down/Tab keys to "browse" stored history of commands.
cmder is a bundle of tools including clink, which integrates into cmd.exe and process cmd's prompt internally. So, in cmder by default Up/Down/Tab arrows are processed by clink.
More info is here: http://conemu.github.io/en/TabCompletion.html

How to kill a tmux pane along with the process running on it?

Let's say you run a command like grunt serve on a tmux pane,
and you kill the pane on which the command is running. I found that
the process is not killed:
ps aux | grep grunt
still shows that grunt is running even though the pane is gone.
How do you kill a tmux pane along with the process(es)?
To stop the program running you can close the pane by entering <C-B> x and then entering y.
Just do: <CTRL-B>:kill-pane
Use Ctrl + b¹, > to get a menu with this and other useful commands:
This is what uses the Spotify plugin.
¹ Or the chosen tmux escape sequence.
Other notes and sources
tmux list-keys | grep display-menu #
curl cht.sh/tmux # Online cheatsheet
https://wiki.archlinux.org/title/tmux
You may find the tmux-safekill plugin useful.
I wanted it to kill Ruby processes, so I had to fork the repo to add that functionality in, so I'm sure you could do the same for grunt processes if you don't get all the functionality you need from the repo directly.

How do I enable ctrl-c escaping in RStudio's vim editing mode?

RStudio has a nice vim editing mode. However, having to reach all the way to the escape key for escaping is demoralizing. Vim allows you to use ctrl-c to e.g. exit editing mode. Is it possible to enable ctrl-c escaping in RStudio's vim editing mode?
What version of RStudio are you using, and what platform?
With RStudio v0.99, Ctrl + C should exit insert mode; it looks like perhaps this isn't the case on Windows. I'll file a bug for RStudio and hopefully it will be resolved for the next release.
(I am guessing that the issue here is that we have a conflict between Copy (normally Ctrl + C) and the 'exit insert mode' behaviour we might normally want when Vim keybindings are enabled.)

Clear console in cygwin console for windows: command not found

I use cygwin console for windows, but when I type clear, it says:
command not found
How can I clear the console?
You may use Ctrl + L
On Linux the clear command would be cls, but this command doesn't seem to work in cygwin. (At least not when I tested it.)

Resources