<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Notepad&#43;&#43; on Voltaicforge</title>
        <link>https://6e2dbc8c.voltaicforge.pages.dev/tags/notepad&#43;&#43;/</link>
        <description>Recent content in Notepad&#43;&#43; on Voltaicforge</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-au</language>
        <lastBuildDate>Sun, 01 May 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://6e2dbc8c.voltaicforge.pages.dev/tags/notepad++/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Docking a PuTTY window into Notepad&#43;&#43;</title>
        <link>https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/</link>
        <pubDate>Sun, 01 May 2016 00:00:00 +0000</pubDate>
        
        <guid>https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/</guid>
        <description>&lt;img src="https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/putty_teaser.png" alt="Featured image of post Docking a PuTTY window into Notepad&#43;&#43;" /&gt;&lt;h2 id=&#34;challenge-of-developing-in-jekyll-via-remote-linux-server&#34;&gt;Challenge of developing in Jekyll via remote Linux server&lt;/h2&gt;
&lt;p&gt;During development of this site, I came across too many limitations with using Jekyll on Windows. You can use Jekyll in Windows with &lt;a class=&#34;link&#34; href=&#34;https://github.com/madhur/PortableJekyll&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;PortableJekyll&lt;/a&gt;, but I found the Windows environment still limited Jekyll. Mainly ImageMagick for using responsive images, which isn’t worth the hassle of setting up on Windows. I decided it was easier to spool up a Debian VM on my virtual server to install Gem/Ruby/Jekyll on. This lets me keep the website code on my NAS (allowing for easy cloud backup), code on Windows, and run Jekyll on Linux.&lt;/p&gt;
&lt;p&gt;However, swapping back and forward between a terminal and the website code to site build was annoying, so I decided to see if I could ‘dock’ a PuTTY terminal into Notepad++&lt;/p&gt;
&lt;h2 id=&#34;adding-a-putty-terminal-into-notepad&#34;&gt;Adding a Putty Terminal into Notepad++&lt;/h2&gt;
&lt;p&gt;I’ve been using &lt;a class=&#34;link&#34; href=&#34;https://notepad-plus-plus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Notepad++&lt;/a&gt; to develop in Windows for quite some time now. It’s a fantastic little program for us Windows people. A docked PuTTY window would greatly improve my workflow.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/putty_terminal_in_npp2.png&#34;
  width=&#34;1179&#34;
  height=&#34;941&#34;
  srcset=&#34;https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/putty_terminal_in_npp2_hu7d34ed4b4e283d1ea3b71933d17998e7_99800_480x0_resize_catmullrom_3.png 480w, https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/putty_terminal_in_npp2_hu7d34ed4b4e283d1ea3b71933d17998e7_99800_1024x0_resize_catmullrom_3.png 1024w&#34;
  loading=&#34;lazy&#34;
  
    alt=&#34;Picture of Notepad&amp;#43;&amp;#43; with attached PuTTY terminal&#34;
  
  
    class=&#34;gallery-image&#34; 
    data-flex-grow=&#34;125&#34;
    data-flex-basis=&#34;300px&#34;
  
&gt;
&lt;/p&gt;
&lt;p&gt;To do the same as I have above, it’s actually pretty simple.&lt;/p&gt;
&lt;p&gt;Download:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Plink&lt;/a&gt; - PuTTY command line&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Ansicon&lt;/del&gt; - (Git repo defunct) Ansi escape sequence converter (to convert Linux CLI escape codes to Windows CLI, else the terminal doesn&amp;rsquo;t work well)&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://sourceforge.net/projects/nppconsole/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;nppconsole&lt;/a&gt; - Notepad++ console plugin.
&lt;blockquote class=&#34;book-hint warning&#34;&gt;
  &lt;b&gt;Warning:&lt;/b&gt; I had to use the older &lt;code&gt;11.53&lt;/code&gt; ansicon version under Windows 10 x64, the later versions crashed frequently.
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The do the following&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Extract &lt;em&gt;NPPConsole&lt;/em&gt; to your Notepad++ plugins directory (Program Files x86/Notepad++/Plugins)&lt;/li&gt;
&lt;li&gt;Restart Notepad++ if it&amp;rsquo;s running&lt;/li&gt;
&lt;li&gt;Unzip and copy &lt;em&gt;plink&lt;/em&gt; and &lt;em&gt;ansicon&lt;/em&gt; to a folder of your choosing (I put them both in the Notepad++ folder as it&amp;rsquo;s where the CLI defaults to, and I’m lazy)&lt;/li&gt;
&lt;li&gt;Open a CLI at the Notepad++ folder and run &lt;code&gt;ansicon.exe plink.exe -ssh user@location -pw yourpasword&lt;/code&gt;, replacing the relevant parts with your user/server IP/password.&lt;/li&gt;
&lt;li&gt;All going well, you can now replicate that command in Notepad++. Open Notepad++, select &lt;em&gt;Plugins -&amp;gt; NppConsole&lt;/em&gt; (should be there if you restarted and copied the dll correctly). Run the command and you are set!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you have a saved profile in PuTTy you can replace the command with &lt;code&gt;ansicon plink -ssh SESSION_NAME&lt;/code&gt; , replacing &lt;code&gt;SESSION_NAME&lt;/code&gt; with your sessions name from the PuTTY dialogue. This works with key authentication as well, which I much prefer to use. This also saves you the risk of keeping a plaintext password in a potentially insecure location.&lt;/p&gt;
&lt;blockquote class=&#34;book-hint info&#34;&gt;
  &lt;b&gt;Info:&lt;/b&gt; You can use the plugin Nppexec as well instead of NppConsole - but I prefer Nppconsole for this.
&lt;/blockquote&gt;

&lt;p&gt;You now have a working CLI in Notepad++ that can call an SSH session. I wrote a few batch scripts, so I just have to run &lt;code&gt;site-dev&lt;/code&gt; in Windows to jump to my Linux VM that contains Jekyll, then &lt;code&gt;./site-dev&lt;/code&gt; to run a bash script to call up Jekyll in dev mode. Already having made a &lt;code&gt;site-push&lt;/code&gt; bash to push the site to Amazon AWS, so I don’t need to leave Notepad++ to do any development work.&lt;/p&gt;
&lt;p&gt;I couldn’t get Ctrl-C to work with either NppConsole or NppExec, both terminate the command without sending SIGTERM or similar to the PuTTY. Let me know if you figure out a way around this, as it means it’s difficult to gracefully terminate Jekyll. Workaround below.&lt;/p&gt;
&lt;h2 id=&#34;workaround-for-no-ctrl-c-to-exit-jekyll&#34;&gt;Workaround for no Ctrl-C to exit Jekyll&lt;/h2&gt;
&lt;p&gt;My workaround for this has become to have a PuTTY terminal open just for stopping Jekyll. This isn’t as bad as it sounds. Just write a bash script to kill ruby as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pgrep ruby &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; xargs &lt;span class=&#34;nb&#34;&gt;kill&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote class=&#34;book-hint warning&#34;&gt;
  &lt;b&gt;Warning:&lt;/b&gt; This will kill all ruby threads! Note this if you often have other ruby threads often running
&lt;/blockquote&gt;

&lt;p&gt;I saved it as &lt;code&gt;site-kill&lt;/code&gt;. My workflow is &lt;code&gt;site-dev&lt;/code&gt; for the development of this site (with dev flags for config, etc.), &lt;code&gt;site-push&lt;/code&gt; to rebuild the site from scratch and push to AWS. The new &lt;code&gt;site-kill&lt;/code&gt; kills off any ruby threads.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/ctrl_c_workaround.png&#34;
  width=&#34;932&#34;
  height=&#34;458&#34;
  srcset=&#34;https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/ctrl_c_workaround_huf87992d0dc7f47f66ab8f82d597439e6_35490_480x0_resize_catmullrom_3.png 480w, https://6e2dbc8c.voltaicforge.pages.dev/p/2016/05/ssh-terminal-in-notepadpp/ctrl_c_workaround_huf87992d0dc7f47f66ab8f82d597439e6_35490_1024x0_resize_catmullrom_3.png 1024w&#34;
  loading=&#34;lazy&#34;
  
    alt=&#34;Picture of using external ssh script to kill jekyll window instead of killing notepad&amp;#43;&amp;#43; CLI&#34;
  
  
    class=&#34;gallery-image&#34; 
    data-flex-grow=&#34;203&#34;
    data-flex-basis=&#34;488px&#34;
  
&gt;
&lt;/p&gt;
&lt;h2 id=&#34;bonus---markdown-highlighting-in-notepad&#34;&gt;Bonus - Markdown highlighting in Notepad++&lt;/h2&gt;
&lt;p&gt;The default colours finally made me crack during writing this post. Too much white! The language highlighting file I had for Markdown didn’t play ball with custom styles.&lt;/p&gt;
&lt;p&gt;I found a language highlighting file for Markdown on &lt;a class=&#34;link&#34; href=&#34;https://github.com/Edditoria/markdown_npp_zenburn&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;GitHub&lt;/a&gt; that had a file for the Zenburn colour scheme. This is what you can see in the screenshots above. So much better!&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
