Mryqu's Notes


  • 首页

  • 搜索
close

CTRL+C无法中断Git Bash中运行的Spring Boot程序

时间: 2019-07-12   |   分类: Tool     |   阅读: 66 字 ~1分钟

在Git Bash中通过gradle bootRun的方式运行Spring Boot程序,使用CTRL+C无法中断运行的程序,重启计算机才能重新运行Spring Boot程序。
忍了很久,最近查了查,发现是Msys2使用的MinTTY终端无法争取地将CTRL+C传递给应用导致的。
CTRL-C doesn’t interrupt the running process #684
CTRL-C doesn’t stop running app in Windows #773
Re: Ctrl-C and non-cygwin programs
Unable to use CTRL-C, ’n’ and ‘q’ keyboard commands in Cygwin and Msys2 shells #112
Ctrl+C no longer kills running process in Git Bash

在最后一个帖子中查找到适用于我使用场景的workaround:

  1. 通过文件浏览器在Git目录中删除usr\bin\mintty.exe文件
  2. 重新运行Git Bash(或在文件浏览器中直接双击git-bash.exe)
# 删除mintty前
$ echo $TERM
xterm


# 删除mintty后
$ echo $TERM
cygwin

标题:CTRL+C无法中断Git Bash中运行的Spring Boot程序
作者:mryqu
声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!

#CTRL+C# #Git Bash# #MinTTY#
[OpenUI5] 监控Model属性变动
学习使用Minikube
  • 文章目录
  • 站点概览

Programmer & Architect

662 日志
27 分类
1472 标签
GitHub Twitter FB Page
© 2009 - 2023 Mryqu's Notes
Powered by - Hugo v0.120.4
Theme by - NexT
0%