{"id":856,"date":"2013-06-24T20:16:27","date_gmt":"2013-06-24T12:16:27","guid":{"rendered":"http:\/\/www.hawkwithwind.net\/blog\/?p=856"},"modified":"2013-07-30T09:19:30","modified_gmt":"2013-07-30T01:19:30","slug":"emacs-cygwin-again","status":"publish","type":"post","link":"https:\/\/www.hawkwithwind.net\/blog\/2013\/06\/24\/emacs-cygwin-again\/","title":{"rendered":"emacs + cygwin again"},"content":{"rendered":"<p>\u4e24\u5e74\u524d\u6211\u5199\u4e86\u4e00\u7bc7\u535a<a href=\"http:\/\/www.hawkwithwind.net\/blog\/2011\/03\/21\/emacs-cygwin-fail\/\">emacs + cygwin fail<\/a>\uff0c\u8bf4\u7684\u662f\u5728cygwin\u4e2d\u4f7f\u7528emacs\u7684\u79cd\u79cd\u4e0d\u4fbf\u3002\u8fd9\u4e9b\u95ee\u9898\u5df2\u7ecf\u5f97\u5230\u89e3\u51b3\u3002\u4f46\u5982\u4eca\u6211\u7684\u9700\u6c42\u53c8\u6709\u4e86\u8f6c\u53d8\uff0c\u60f3\u5728native emacs on windows\u4e0a\u4f7f\u7528cygwin\u4f5c\u4e3ashell\uff0c\u4e8e\u662f\u53c8\u4ea7\u751f\u4e86\u65b0\u7684\u95ee\u9898\u3002\u4eca\u5929\u770b\u5230ownwaterloo\u5728\u6211\u535a\u5ba2\u91cc\u7684\u7559\u8a00\uff0c\u60f3\u5230\u5e94\u8be5\u82b1\u70b9\u65f6\u95f4\u628a\u4ee5\u524d\u9057\u7559\u4e0b\u6765\u7684\u95ee\u9898\u89e3\u51b3\u6389\uff0c\u4e8e\u662f\u6709\u4e86\u8fd9\u7bc7\u6587\u7ae0\u3002<\/p>\n<p>\u5728emacs\u4e2d\u4f7f\u7528cygwin\u4f5c\u4e3ashell\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2acygwin-shell.el<br \/>\n<a href=\"http:\/\/lists.gnu.org\/archive\/html\/help-gnu-emacs\/2010-02\/msg00668.html\">http:\/\/lists.gnu.org\/archive\/html\/help-gnu-emacs\/2010-02\/msg00668.html<\/a><\/p>\n<p>\u7136\u540e\u5728.emacs\u4e2d\u5982\u6b64\u542f\u7528\u4e4b<\/p>\n<pre><code class=\"lisp\">\r\n(load \"D:\\\\programs\\\\emacs-24.3\\\\site-lisp\\\\cygwin-shell.el\")\r\n<\/code><\/pre>\n<p>\u4e3a\u4e86\u65b9\u4fbf\u53ef\u4ee5\u7ed1\u5b9a\u4e00\u4e2a\u5feb\u6377\u952e<\/p>\n<pre><code class=\"lisp\">\r\n(global-set-key (kbd \"M-s\") 'cygwin-shell)\r\n<\/code><\/pre>\n<p><a href=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_break_emacs.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_break_emacs.png\" alt=\"cygwin_break_emacs\" width=\"618\" height=\"209\" class=\"aligncenter size-full wp-image-857\" srcset=\"https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_break_emacs.png 618w, https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_break_emacs-300x101.png 300w\" sizes=\"auto, (max-width: 618px) 100vw, 618px\" \/><\/a><\/p>\n<p>\u91cd\u542femacs\u8bd5\u7528\uff0c\u53d1\u73b0\u4e0d\u5de5\u4f5c\uff0c\u539f\u6765\u662fbash\u7684\u8def\u5f84\u9700\u8981\u586b\u5bf9\uff1a<\/p>\n<pre><code class=\"lisp\">\r\n(let* ((shell-file-name \"D:\\\\cygwin\\\\bin\\\\bash\")\r\n<\/code><\/pre>\n<p>\u518d\u8fdb\u53bb\u770b\uff0c\u53ef\u4ee5\u7528\u4e86\uff0c\u4f46\u662f\u63d0\u793a\u7b26\u4e71\u7801\u3002\u6839\u636e\u7f51\u4e0a\u7684\u4e00\u4e9b\u8ba8\u8bba\uff0c\u6253\u5f00bash.bashrc\u67e5\u770b<\/p>\n<pre><code class=\"bash\">\r\n# Set a default prompt of: user@host and current_directory\r\nPS1='\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\$ '\r\n<\/code><\/pre>\n<p>\u7531\u4e8e\u6211\u7528\u7684emacs\u7248\u672c\u652f\u6301\u5206\u8272\u663e\u793a\uff0c\u6211\u5220\u9664\u4e86\u524d\u9762\u7684\\w\\a\u90e8\u5206\uff0c\u4fdd\u7559\u4e86\u5206\u8272\u663e\u793a\u7684\\u@\\h\u90e8\u5206\u3002<\/p>\n<pre><code class=\"bash\">\r\n# Set a default prompt of: user@host and current_directory\r\nif [[ $TERM = \"emacs\" ]]; then\r\n    PS1='\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\$ '\r\nelse    \r\n    PS1='\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\$ '\r\nfi\r\n<\/code><\/pre>\n<p>\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u767b\u5f55\u8fdb\u53bb\u540e\u663e\u793a\u4e24\u884c\u9519\u8bef\uff1a<\/p>\n<pre>\r\nbash: cannot set terminal process group (-1): Inappropriate ioctl for device\r\nbash: no job control in this shell\r\n<\/pre>\n<p>\u8fd9\u662f\u8bf4emacs\u6ca1\u6709\u63d0\u4f9bTTY\u7ed9bash\uff0c\u56e0\u6b64bash\u62d2\u7edd\u63d0\u4f9bjob control\u529f\u80fd\uff0c\u4e5f\u5c31\u662f\u8bf4C-c\u5f3a\u5173\u8fdb\u7a0b\u3001&#038;\u540e\u53f0\u6267\u884c\u3001C-z\u6302\u8d77\u7b49\u547d\u4ee4\u884c\u529f\u80fd\u90fd\u4e0d\u80fd\u4f7f\u7528\uff0c\u975e\u5e38\u4e0d\u4fbf\u3002\u5176\u5b9e\u6211\u4e00\u822c\u4e0d\u592a\u7528\u5230\u8fd9\u4e9b\u529f\u80fd\uff0c\u5076\u5c14\u7528\u5230\u5c31\u7528emacs\u7684\u591a\u7a97\u53e3\u5f00\u591a\u4e2a\u7a97\u53e3\u6765\u6267\u884c\u4e0d\u540c\u7684\u547d\u4ee4\uff0c\u5f88\u957f\u65f6\u95f4\u5c31\u6ca1\u6709\u53bb\u7ba1\u4ed6\u3002\u4eca\u5929\u7531\u4e8e\u8ddfownwaterloo\u90ae\u4ef6\u63d0\u5230\uff0c\u5c31\u60f3\u8bd5\u8bd5\u89e3\u51b3\u4e00\u4e0b\u3002\u6839\u636e\u7f51\u4e0a\u7684\u8bf4\u6cd5\uff0c\u8fd9\u662f\u4e2a\u6ca1\u6709\u89e3\u7684BUG\u3002\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/9670209\/cygwin-bash-does-not-display-correctly-in-emacs-shell\">stackoverflow: cygwin bash does not display correctly in emacs shell<\/a><\/li>\n<li><a href=\"http:\/\/www.emacswiki.org\/emacs\/NTEmacsWithCygwin\">NTEmacs breaks cygwin bash<\/a><\/li>\n<\/ul>\n<p>\u4e0d\u8fc7\u8fd9\u4e2a\u95ee\u9898\u662f\u4ececygwin 1.7.10\u4e4b\u540e\u624d\u51fa\u73b0\u7684\uff0c\u53ef\u4ee5\u627e\u5230\u8bb8\u591a\u5e16\u5b50\u5728\u5347\u7ea7\u52301.7.10~1.7.11\u8fc7\u7a0b\u4e2d\u62b1\u6028\u8fd9\u4e2a\u4e8b\u60c5<\/p>\n<ul>\n<li><a href=\"http:\/\/cygwin.1069669.n5.nabble.com\/bash-under-emacs-gives-quot-cannot-set-terminal-process-group-quot-td6734.html\">bash under emacs gives &#8220;cannot set terminal process group&#8221;<\/a><\/li>\n<li><a href=\"http:\/\/comments.gmane.org\/gmane.os.cygwin\/132165\">&#8220;Inappropriate ioctl for device&#8221; problem using latest cygwin as a shell within native (non-cygwin) GnuEmac<\/a><\/li>\n<\/ul>\n<p>\u65e2\u7136\u5982\u6b64\uff0c\u5c31\u4e0d\u53bb\u8d39\u5fc3\u7422\u78e8\u600e\u6837\u80fd\u7ed9cygwin\u4e00\u4e2aTTY\u73af\u5883\u4e86\u3002\u53ea\u597d\u6839\u636e\u4eba\u5bb6\u63d0\u4f9b\u7684\u4e24\u6761\u89e3\u51b3\u65b9\u6848\u60f3\u60f3\u770b\u600e\u6837\u53bb\u627e\u5230\u65e7\u7248\u672c\u7684cygwin\u3002<\/p>\n<pre>\r\nWorkarounds:\r\n\r\n* Use Cygwin Emacs (package emacs-w32 uses the windows GUI, there are also X11 and console packages)\r\n* Don\u2019t upgrade Cygwin above, I think Cygwin1.dll, version 1.7.9.\r\n<\/pre>\n<p>\u7531\u4e8ecygwin\u5b98\u7f51\u5e76\u4e0d\u63d0\u4f9b\u65e7\u7248\u672c\u7684cygwin\u5b89\u88c5\uff0c\u53ea\u597d\u53bb\u627e\u65e7\u7248\u672c\u7684\u955c\u50cf\u3002\u6211\u5c1d\u8bd5\u4e86\u8bb8\u591a\u5173\u952e\u8bcd\uff0c\u641c\u4e86\u4e00\u4e0b\u5348\uff0c\u8e0f\u904d\u65e0\u6570\u56fd\u5916\u7684\u5783\u573e\u4e0b\u8f7d\u7ad9\uff0c\u88ab\u5404\u79cd\u5751\u9a97\u4e4b\u540e\uff0c\u7ec8\u4e8e\u5728\u4e00\u4e2a\u5fc5\u987b\u6ce8\u518c\u624d\u80fd\u4e0b\u8f7d\u7684\u7f51\u7ad9\u627e\u5230\u4e86\u53ef\u4ee5\u5b89\u88c5\u76841.7.9\u7248\u672c\uff0c\u53f7\u79f0\u6700\u540e\u4e00\u4e2a\u517c\u5bb9emacs\u7684cygwin\u7248\u672c\u7684\u4e0b\u8f7d<br \/>\n<a href=\"http:\/\/search.4shared.com\/postDownload\/lMzinjJj\/cygwin_179-1.html\">http:\/\/search.4shared.com\/postDownload\/lMzinjJj\/cygwin_179-1.html<\/a><br \/>\n<a href=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/emacs-cygwin.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/emacs-cygwin.png\" alt=\"emacs-cygwin\" width=\"640\" height=\"275\" class=\"aligncenter size-full wp-image-864\" srcset=\"https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/emacs-cygwin.png 640w, https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/emacs-cygwin-300x128.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>\u76f4\u63a5\u5c061.7.9\u7684cygwin1.dll\u62f7\u8d1d\u5230bin\u76ee\u5f55\u662f\u4e0d\u53ef\u884c\u7684\uff0c\u6211\u4e0b\u8f7d\u5e76\u5c1d\u8bd5\u8fc7\uff0cbash\u53ef\u4ee5\u6267\u884c\uff0c\u4f46\u662f\u4e00\u4e9b\u547d\u4ee4\uff0c\u5982ls\u548csvn\u6267\u884c\u6ca1\u6709\u8f93\u51fa\u3002\u5947\u602a\u7684\u662f\u5176\u4ed6\u7684\u7a0b\u5e8f\u5982grep\u548cgit\u53c8\u53ef\u4ee5\u6267\u884c\uff0c\u53ef\u80fd\u53ea\u662f\u51e0\u4e2a\u51fd\u6570\u7684\u6302\u63a5\u70b9\u6709\u53d8\u5316\u4e86\u5427\u3002\u56e0\u6b64\u5fc5\u987b\u91cd\u65b0\u5b89\u88c5\u4e00\u904dcygwin\u3002\u65b9\u6cd5\u662f\u542f\u52a8\u65e7\u7248\u672c\u7684setup.exe\u540e\uff0c\u9009\u62e9\u201cInstall from Local Directory\u201d\uff0c\u5e76\u5728\u540e\u7eed\u6b65\u9aa4\u4e2d\u7684\u201cLocal Package Directory\u201d\u9009\u62e9\u4e0b\u8f7d\u6587\u4ef6\u9644\u5e26\u7684\u90a3\u4e2a\u8def\u5f84\u201cCygwin_Arquivos\u201d\uff08\u6211\u67e5\u4e86\u4e00\u4e0b\u8fd9\u4f3c\u4e4e\u662f\u8461\u8404\u7259\u8bed\u7684Archive\u7684\u610f\u601d\uff0c\u611f\u8c22\u8fd9\u4f4d\u8461\u8bed\u7a0b\u5e8f\u5458\uff01\uff09<br \/>\n<a href=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_arquivos.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_arquivos.png\" alt=\"cygwin_arquivos\" width=\"390\" height=\"123\" class=\"aligncenter size-full wp-image-868\" srcset=\"https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_arquivos.png 390w, https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/cygwin_arquivos-300x94.png 300w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><\/a><\/p>\n<p>\u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u4e00\u79cd\u65b9\u6848\u662f\u53ef\u4ee5\u5c06cygwin-shell.el\u4e2d\u7684bash\u8def\u5f84\u6307\u5411\u65b0\u88c5\u597d\u7684cygwin\u8def\u5f84\uff0c\u6211\u6ca1\u6709\u91c7\u7528\u3002\u7531\u4e8e\u6211\u5df2\u7ecf\u5728\u539f\u6709\u7684cygwin 1.7.20\u7248\u672c\u4e2d\u5b89\u88c5\u4e86\u4e0d\u5c11\u5e94\u7528\uff0c\u4e0d\u60f3\u5207\u6362\u76ee\u5f55\u4e86\uff0c\u56e0\u6b64\u6211\u5c1d\u8bd5\u5c061.7.9\u7684bin\u76ee\u5f55\u8986\u76d6\u52301.7.20\u4e2d\u53bb\u3002<del datetime=\"2013-07-30T01:15:20+00:00\">\u5c45\u7136\u6210\u529f\u4e86\uff01<\/del>[\u5176\u5b9e\u5931\u8d25\u4e86&#8230;]<\/p>\n<p>\u8fd9\u6b21\u5728emacs\u4e2d\u6d4b\u8bd5\uff0c\u6b63\u786e\u542f\u52a8\uff0c\u4e00\u5207\u547d\u4ee4\u6b63\u5e38\uff01\u6709\u8da3\u7684\u662f\uff0c\u7528cygcheck -c cygwin\u68c0\u6d4b\uff0c\u67e5\u51fa\u6765\u7684\u7248\u672c\u8fd8\u662f1.7.20\u7248\u672c\u3002\u800c\u4e14\u65b0\u7248\u7684mintty.exe\u4e5f\u53ef\u4ee5\u6b63\u786e\u7684\u4f7f\u7528\u3002\u975e\u5e38\u5f00\u5fc3\uff5e\u8fd9\u6682\u65f6\u53ef\u4ee5\u7b97\u662f\u5b8c\u7f8e\u89e3\u51b3\u4e86\uff5e<\/p>\n<p>\u5047\u5982\u6709\u5176\u4ed6\u4eba\u6070\u597d\u6709\u8ddf\u6211\u4e00\u6837\u7684\u86cb\u75bc\u9700\u6c42\uff0c\u60f3\u5728windows native emacs\u4e2d\u542f\u7528cygwin\uff0c\u53c8\u4e0d\u582a\u5404\u79cd\u5751\u67e5\u5230\u6211\u7684\u535a\u5ba2\uff0c\u4e3a\u4e86\u65b9\u4fbf\u8fd9\u6837\u7684\u5c0f\u4f17\u540c\u597d\uff0c\u6211\u8fd9\u91cc\u7ed9\u4e00\u4e2a\u767e\u5ea6\u7f51\u76d8\u7684link\u5427\u3002\u8bf4\u5b9e\u8bdd\u767e\u5ea6\u5f00\u653e\u7f51\u76d8\u5185\u5bb9\u641c\u7d22\u8fd8\u7b97\u633a\u6709\u7528\u7684\uff08\u867d\u7136\u603b\u611f\u89c9\u633a\u53ef\u6015\u7684\u3002\u3002\uff09\uff0c\u6211\u66fe\u5e7b\u60f3\u5728google\u4e2d site:pan.baidu.com \u641c\u7d22cygwin 1.7.9\u5c31\u80fd\u641c\u5230\u7a0b\u5e8f\u5305\uff0c\u53ef\u60dc\u5931\u8d25\u4e86\u3002\u8fd9\u6b21\u6211\u63d0\u4f9b\u516c\u5f00\u4e0b\u8f7d\uff0c\u672a\u6765\u518d\u8fd9\u6837\u641c\u7d22\u7684\u4eba\u5c31\u80fd\u5f97\u5230\u65b9\u4fbf\u4e86\u5427\uff01<\/p>\n<p>[cygwin 1.7.9 \u672c\u5730\u5b89\u88c5\u5305] <a href=\"http:\/\/pan.baidu.com\/share\/link?shareid=661677505&#038;uk=3423312229\">http:\/\/pan.baidu.com\/share\/link?shareid=661677505&#038;uk=3423312229<\/a><\/p>\n<blockquote>\n<h3>\u540e\u6ce8<\/h3>\n<ul>\n<li>\u4e8b\u5b9e\u4e0a\u76f4\u63a5\u5c061.7.9 bin\u76ee\u5f55\u4e2d\u7684\u5185\u5bb9\u8986\u76d6\u52301.7.20\u4e2d\u662f\u4e0d\u884c\u7684\uff0c\u90e8\u5206\u7a0b\u5e8f\u65e0\u6cd5\u6267\u884c\u3002\u8fd8\u662f\u9700\u8981\u8001\u8001\u5b9e\u5b9e\u5c06\u811a\u672c\u4e2d\u7684bash\u8def\u5f84\u6307\u54111.7.9\u7248\u672c\u3002<\/li>\n<li>\u73b0\u5728\u5728Google\u4e2d\u641c\u7d22cygwin 1.7.9 inurl:pan.baidu.com\u4f1a\u76f4\u63a5\u627e\u5230\u8fd9\u4e2a\u8d44\u6e90\u4e86\uff0c\u53ea\u6709\u4e00\u4e2a\u641c\u7d22\u7ed3\u679c\uff0c\u5c31\u662f\u6211\u7684\u94fe\u63a5\uff0c\u54c8\u54c8<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/googlecygwin179.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/googlecygwin179.png\" alt=\"google cygwin 1.7.9\" width=\"641\" height=\"240\" class=\"aligncenter size-full wp-image-890\" srcset=\"https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/googlecygwin179.png 641w, https:\/\/www.hawkwithwind.net\/blog\/wp-content\/uploads\/2013\/06\/googlecygwin179-300x112.png 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/a>\n<\/p><\/blockquote>\n<p>\u672c\u6587\u5f15\u7528\u7684\u56fe\u7247\u548c\u90e8\u5206\u8ba8\u8bba\u6765\u81ea\u7f51\u4e0a\uff0c\u4ee5\u4e0b\u662f\u4e3b\u8981\u53c2\u8003\u6765\u6e90\u7684\u6574\u7406<\/p>\n<h4>\u672c\u6587\u53c2\u8003<\/h4>\n<ul>\n<li>[1] <a href=\"http:\/\/stackoverflow.com\/questions\/235254\/how-can-i-run-cygwin-bash-shell-from-within-emacs\">How can I run Cygwin Bash Shell from within Emacs?<\/a><\/li>\n<li>[2] <a href=\"http:\/\/stackoverflow.com\/questions\/10128961\/i-want-to-run-the-cygwin-bash-shell-from-native-windows-emacs-app\">I want to run the cygwin bash shell from native windows emacs app<\/a><\/li>\n<li>[3] <a href=\"http:\/\/www.emacswiki.org\/emacs\/NTEmacsWithCygwin\">NTEmacsWithCygwin<\/a><\/li>\n<li>[4] <a href=\"https:\/\/github.com\/danluu\/config\/tree\/master\/emacs\/lisp\">emacs cygwin shell<\/a><\/li>\n<li>[5] <a href=\"http:\/\/lists.gnu.org\/archive\/html\/help-gnu-emacs\/2010-02\/msg00668.html\">help-gnu-emacs: emacs cygwin shell<\/a><\/li>\n<li>[6] <a href=\"http:\/\/stackoverflow.com\/questions\/3847981\/cygwin-shell-in-emacs-output-messed-up\">cygwin shell in Emacs &#8211; output messed up?<\/a><\/li>\n<li>[7] <a href=\"http:\/\/stackoverflow.com\/questions\/9670209\/cygwin-bash-does-not-display-correctly-in-emacs-shell\">cygwin bash does not display correctly in emacs shell<\/a><\/li>\n<li>[8] <a href=\"http:\/\/download.cnet.com\/Cygwin\/3000-2212_4-10026629.html\">cnet download: 1.7.9 is the last version play well with emacs<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e24\u5e74\u524d\u6211\u5199\u4e86\u4e00\u7bc7\u535aemacs + cygwin fail\uff0c\u8bf4\u7684\u662f\u5728cygwin\u4e2d\u4f7f\u7528emacs\u7684\u79cd\u79cd\u4e0d\u4fbf\u3002\u8fd9\u4e9b\u95ee\u9898\u5df2\u7ecf\u5f97\u5230\u89e3\u51b3\u3002\u4f46\u5982\u4eca\u6211\u7684\u9700\u6c42\u53c8\u6709\u4e86\u8f6c\u53d8\uff0c\u60f3\u5728native emacs on windows\u4e0a\u4f7f\u7528cygwin\u4f5c\u4e3ashell\uff0c\u4e8e\u662f\u53c8\u4ea7\u751f\u4e86\u65b0\u7684\u95ee\u9898\u3002\u4eca\u5929\u770b\u5230ownwaterloo\u5728\u6211\u535a\u5ba2\u91cc\u7684\u7559\u8a00\uff0c\u60f3\u5230\u5e94\u8be5\u82b1\u70b9\u65f6\u95f4\u628a\u4ee5\u524d\u9057\u7559\u4e0b\u6765\u7684\u95ee\u9898\u89e3\u51b3\u6389\uff0c\u4e8e\u662f\u6709\u4e86\u8fd9\u7bc7\u6587\u7ae0\u3002 \u5728emacs\u4e2d\u4f7f\u7528cygwin\u4f5c\u4e3ashell\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2acygwin-shell.el http:\/\/lists.gnu.org\/archive\/html\/help-gnu-emacs\/2010-02\/msg00668.html \u7136\u540e\u5728.emacs\u4e2d\u5982\u6b64\u542f\u7528\u4e4b (load &#8220;D:\\\\programs\\\\emacs-24.3\\\\site-lisp\\\\cygwin-shell.el&#8221;) \u4e3a\u4e86\u65b9\u4fbf\u53ef\u4ee5\u7ed1\u5b9a\u4e00\u4e2a\u5feb\u6377\u952e (global-set-key (kbd &#8220;M-s&#8221;) &#8216;cygwin-shell) \u91cd\u542femacs\u8bd5\u7528\uff0c\u53d1\u73b0\u4e0d\u5de5\u4f5c\uff0c\u539f\u6765\u662fbash\u7684\u8def\u5f84\u9700\u8981\u586b\u5bf9\uff1a (let* ((shell-file-name &#8220;D:\\\\cygwin\\\\bin\\\\bash&#8221;) \u518d\u8fdb\u53bb\u770b\uff0c\u53ef\u4ee5\u7528\u4e86\uff0c\u4f46\u662f\u63d0\u793a\u7b26\u4e71\u7801\u3002\u6839\u636e\u7f51\u4e0a\u7684\u4e00\u4e9b\u8ba8\u8bba\uff0c\u6253\u5f00bash.bashrc\u67e5\u770b # Set a default prompt of: user@host and current_directory PS1=&#8217;\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\$ &#8216; \u7531\u4e8e\u6211\u7528\u7684emacs\u7248\u672c\u652f\u6301\u5206\u8272\u663e\u793a\uff0c\u6211\u5220\u9664\u4e86\u524d\u9762\u7684\\w\\a\u90e8\u5206\uff0c\u4fdd\u7559\u4e86\u5206\u8272\u663e\u793a\u7684\\u@\\h\u90e8\u5206\u3002 # Set a default prompt of: user@host and current_directory if [[ $TERM = &#8220;emacs&#8221; ]]; then PS1=&#8217;\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\$ &#8216; else &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[53,54,49,36,43],"class_list":["post-856","post","type-post","status-publish","format-standard","hentry","category-post","tag-cygwin","tag-emacs","tag-linux","tag-lisp","tag-tool"],"_links":{"self":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/comments?post=856"}],"version-history":[{"count":14,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/856\/revisions"}],"predecessor-version":[{"id":866,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/856\/revisions\/866"}],"wp:attachment":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/media?parent=856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/categories?post=856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/tags?post=856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}