<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <generator uri="https://gohugo.io/" version="0.78.2">Hugo</generator><title type="html"><![CDATA[curses on Roy's Blog]]></title>
    
        <subtitle type="html"><![CDATA[Mainly about tech stuff I have a hand in]]></subtitle>
    
    
    
            <link href="https://roy.marples.name/blog/tags/curses/" rel="alternate" type="text/html" title="HTML" />
            <link href="https://roy.marples.name/blog/tags/curses/atom.xml" rel="self" type="application/atom+xml" title="Atom" />
            <link href="https://roy.marples.name/blog/tags/curses/feed.json" rel="alternate" type="application/json" title="Json" />
    <updated>2021-03-12T11:08:32+00:00</updated>
    
    <id>https://roy.marples.name/blog/tags/curses/</id>
        
        <entry>
            <title type="html"><![CDATA[NetBSD curses ripoffline improvements]]></title>
            <link href="https://roy.marples.name/blog/posts/netbsd_curses_ripoffline_improvements/?utm_source=atom_feed" rel="alternate" type="text/html"  hreflang="en" />
            <id>https://roy.marples.name/blog/posts/netbsd_curses_ripoffline_improvements/</id>
            
            <published>2018-10-03T17:30:00+00:00</published>
            <updated>2018-10-03T17:30:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>I implemented <a href="http://pubs.opengroup.org/onlinepubs/7908799/xcurses/ripoffline.html">ripoffline(3)</a> in NetBSD and it shipped in-8.
It now transpires there were a few problems with the implementation, mainly in regards to screen resizing, which is an extension to POSIX, but supported by <a href="https://invisible-island.net/ncurses/man/resizeterm.3x.html">ncurses</a> and <a href="https://github.com/wmcbrine/PDCurses">PDCurses</a>.</p>
<p>Many improvements have been made with regards to compability with NetBSD and the others, but there are the following caveats:</p>
<ul>
<li>NetBSD will only resize stdscr, curscr and virtscr windows (like PDCurses)</li>
<li>NetBSD clears the window when resized</li>
<li>NetBSD will re-size and re-position the ripped off lines (like ncurses)</li>
<li>NetBSD will not change LINES when ripoffline is called and may offset stdscr to it&rsquo;s relative position on the screen. This means that portable application should check <a href="http://pubs.opengroup.org/onlinepubs/7908799/xcurses/getbegyx.html">getbegyx and getmaxyx</a> for the size and location of stdscr.</li>
</ul>
<p>The expectation is that the client will re-draw all windows, including ripped off windows on a KEY_RESIZE event.
It&rsquo;s also expected that the client will re-size any other windows as it has a clearer idea of where things should be on the screen to it&rsquo;s proportion rather than curses guesstimating.</p>
<p>Now, the very colourful <a href="https://en.wikipedia.org/wiki/Roguelike">Roguelike</a> game <a href="https://github.com/jaldhar/AitDoB">Ascent into the Depths of Beyond</a> now works on NetBSD <a href="https://github.com/jaldhar/AitDoB/pull/1">with a minor patch</a></p>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://roy.marples.name/blog/tags/netbsd" term="netbsd" label="NetBSD" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/curses" term="curses" label="curses" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/gaming" term="gaming" label="gaming" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Soft Label Keys]]></title>
            <link href="https://roy.marples.name/blog/posts/soft_label_keys/?utm_source=atom_feed" rel="alternate" type="text/html"  hreflang="en" />
            <id>https://roy.marples.name/blog/posts/soft_label_keys/</id>
            
            <published>2017-01-24T20:36:00+00:00</published>
            <updated>2017-01-24T20:36:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p><a href="../2017_starts_with_some_cursing">After starting the year with curses work</a>, I decided to do some more!</p>
<p>Currently we lack <a href="http://pubs.opengroup.org/onlinepubs/7908799/xcurses/slk_init.html">Soft Label Key functions as specified by POSIX</a>. What are these?
Glad you asked! Soft Label Keys ripoff a line from the bottom of the screen and allow for up to 8 keys to be displayed there.
You can define labels for them, colours, etc.</p>
<p><em>&ldquo;BIG WHOOP!&quot;</em> I hear you say. <em>&ldquo;My app already does this, why should I care?&quot;</em></p>
<p>Because SLK also works with the <a href="http://pubs.opengroup.org/onlinepubs/7908799/xcurses/terminfo.html">terminfo database</a> to work out if the terminal natively supports labels <em>(via plab_norm, label_on, etc)</em>!
This means a line doesn&rsquo;t have to be ripped off from the screen so no real-estate is lost. Sadly, no terminal actually seems to support these markings. But if one is ever made, it should work fine.</p>
<p>Now, not many curses apps actually use the SLK functions, probably for this very reason. But some do, and it <strong>is</strong> a standard so I&rsquo;ve coded NetBSD to support this natively.</p>
<p>Sadly, this has uncovered a bug in the NetBSD curses library where cursor movement in a one line window at the bottom of the screen appears to push the window up.
This <strong>is very visible</strong> with SLK and will have to be fixed for any apps that actually use it, but the SLK implementation itself is sound as resizing the terminal forces a redraw and it looks fine.</p>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://roy.marples.name/blog/tags/tech" term="tech" label="tech" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/netbsd" term="netbsd" label="NetBSD" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/curses" term="curses" label="curses" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[2017 starts with some cursing!]]></title>
            <link href="https://roy.marples.name/blog/posts/2017_starts_with_some_cursing/?utm_source=atom_feed" rel="alternate" type="text/html"  hreflang="en" />
            <id>https://roy.marples.name/blog/posts/2017_starts_with_some_cursing/</id>
            
            <published>2017-01-04T20:39:00+00:00</published>
            <updated>2017-01-04T20:39:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>So over the holidays, I managed to get in some good quality family time and find some time to work on some Open Source stuff.
I meant to work mainly on <a href="/dhcpcd">dhcpcd</a>, but it turned out I spent most of my time working on <a href="https://wiki.netbsd.org/curses_in_netbsd/">NetBSD curses library</a> so that <a href="https://docs.python.org/3/howto/curses.html">Python Curses</a> now works with it.
Now, most people reading this blog may not care much for NetBSD or for curses, but it&rsquo;s important because <a href="https://www.gnu.org/software/ncurses/">ncurses</a> is used pretty much everywhere by default &hellip;.. aside from NetBSD. And most readers should know, I go out of my way to promote interoperable software even when it&rsquo;s at a detriment to my own projects. That&rsquo;s just how I roll.</p>
<p>There is a apparently a thing called <a href="https://github.com/wmcbrine/PDCurses">PD Curses</a> but I don&rsquo;t know anywhere that actually uses it by default.
If you know, please email me @ <a href="mailto:roy@marples.name">roy@marples.name</a> or <a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=@rsmarples PD Curses is used ...">tweet me</a>. I do know that the <a href="https://www.pkgsrc.org/">pkgsrc</a> <a href="http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/mk/curses.buildlink3.mk?rev=1.23&amp;content-type=text/x-cvsweb-markup&amp;only_with_tag=MAIN">curses framework</a> supports it.</p>
<p>And this is the thing I&rsquo;m currently doing. As NetBSD curses supports more POSIX functions (and a few ncurses extensions, sadly) more and more packages now work alongside NetBSD curses, so I&rsquo;m plowing through pkgsrc again moving things to the curses framework.
This is important, because there is logic in devel/ncurses to use NetBSD curses when passing certain criteria, but sadly this always brings ncurses as a possibility to be linked or it&rsquo;s header used, both of which are quite bad for NetBSD curses so there is a method to my madness.</p>
<p>One interesting thing though is that since I started comitting my curses patches, it turns out that <a href="http://sabotage.tech/">Sabotage Linux</a> is using NetBSD curses <a href="https://github.com/sabotage-linux/netbsd-curses">and made it portable</a>.
I&rsquo;m chatting with one of their devs and we&rsquo;re starting to merge of a few of their patches back into NetBSD.</p>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://roy.marples.name/blog/tags/tech" term="tech" label="tech" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/netbsd" term="netbsd" label="NetBSD" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/curses" term="curses" label="curses" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[terminfo married to curses]]></title>
            <link href="https://roy.marples.name/blog/posts/terminfo_married_to_curses/?utm_source=atom_feed" rel="alternate" type="text/html"  hreflang="en" />
            <id>https://roy.marples.name/blog/posts/terminfo_married_to_curses/</id>
            
            <published>2009-12-08T12:32:00+00:00</published>
            <updated>2009-12-08T12:32:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>My prior <a href="blog:2009/09/25">terminfo</a> work has been completed and merged with curses. Userland applications have been re-worked where needed and everything is working just fine!</p>
<p>So NetBSD finally has an up to date replacement for the legacy termcap it currently uses. Well, it will have when merged - I&rsquo;ve only just <a href="http://mail-index.netbsd.org/tech-userlevel/2009/12/08/msg003017.html">asked for testing</a> so it might take some time before it hits-current.</p>
]]></content>
            
                 
                    
                         
                        
                            
                             
                                <category scheme="https://roy.marples.name/blog/tags/netbsd" term="netbsd" label="NetBSD" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/curses" term="curses" label="curses" />
                             
                                <category scheme="https://roy.marples.name/blog/tags/terminfo" term="terminfo" label="terminfo" />
                            
                        
                    
                
            
        </entry>
    
</feed>
