Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsd-curses versus ncurses #442

Open
bkauler opened this issue May 22, 2016 · 10 comments
Open

bsd-curses versus ncurses #442

bkauler opened this issue May 22, 2016 · 10 comments

Comments

@bkauler
Copy link

bkauler commented May 22, 2016

Just a note about an experience with bsd-curses versus ncurses.

I built Sabotage, installed it in a Flash stick. I built 'mp' a nice console text editor, that we have used for ages in Puppy Linux and derivatives. Here is my recipe:
https://github.com/bkauler/sabotage/blob/master/pkg/mp

Problem though, it was unusable. Scrolling was haywire. For example, I moved the cursor down to the bottom of the window, and only the bottom line would scroll, not the rest of the window. It was a mess.

I had never encountered this problem before, so suspected bsd-curses.

I have done a complete rebuild using ncurses, this time mp works perfectly. Here is my recipe for ncurses:
https://github.com/bkauler/sabotage/blob/master/pkg/qky-ncurses

...I had to jump through a lot of hoops to get all the packages to build with ncurses. Got some help from LFS, plus some creativity of my own.

I am posting this just for the general information of the Sabotage developers. If bsd-curses works for you, you will probably want to stay with it.

@rofl0r
Copy link
Member

rofl0r commented May 22, 2016

thanks for the info. we at sabotage generally fix bugs, rather than working around them by using another version or replacement of a package.
that said, i'll look at why mp is misbehaving with netbsd-curses.

@rofl0r
Copy link
Member

rofl0r commented May 22, 2016

i just added a package mp cba0e0e it's using latest official tarball from upstream, and everything works perfect with curses - there was only a little issue i needed to fix to prevent it segfaulting @ line 17 of the package (apparently mp's author assumed that passing NULL instead of a valid WINDOW* to curses functions makes it automatically use stdscr).

@bkauler
Copy link
Author

bkauler commented May 22, 2016

That's good that it works. I used a very old version of mp, 3.2.13. Latest, that you are using, is 5.2.10.

Just a note: that wasn't the only reason I went over to ncurses. Ncurses is what I have always used, very familiar with, and wanted to do a Sabotage build with it anyway. Except couldn't, had to fix the recipe. Now, it can be used in place of bsd-curses if anyone desires.

@bkauler bkauler closed this as completed May 22, 2016
@rofl0r
Copy link
Member

rofl0r commented May 22, 2016

are you planning to use the latest version or do you have a reason to stick to yours ?

@bkauler
Copy link
Author

bkauler commented May 22, 2016

Oh, I should also reply that another reason I did a build with ncurses was to verify that bsd-curses was indeed the cause of the problem with mp.

There was a reason why I stayed with the older version of mp, back when I was developing for Puppy Linux. Can't remember now.
Anyway, the old version works fine, at least with ncurses.

@rofl0r
Copy link
Member

rofl0r commented May 22, 2016

just found that the version you're using still lives on the original site
http://triptico.com/download/ , so let's test it..

@rofl0r
Copy link
Member

rofl0r commented May 22, 2016

so far the only issue with it is that it begins scrolling down not in the last line but in the previous-to-last line, but the same happens when linked against ncurses.

rofl0r added a commit that referenced this issue May 22, 2016
@rofl0r
Copy link
Member

rofl0r commented May 22, 2016

yeah, that's it. i cannot identify any differences when built against curses vs ncurses
note that you can easily test yourself:

butch unlink ncurses
butch rebuild curses
# ... build stuff against curses, testing...
butch unlink curses
butch relink ncurses
# ... build stuff against ncurses....

@bkauler
Copy link
Author

bkauler commented May 23, 2016

The old version of mp is working perfectly for me.
I wonder if that is because my recipe for ncurses is different:
https://github.com/bkauler/sabotage/blob/master/pkg/qky-ncurses

Whatever, mp works fine. I did have a problem before with the borders around mp displaying as characters instead of lines, but that was a matter of setting env. variable TERM=xterm when used with bash.

@bkauler
Copy link
Author

bkauler commented May 24, 2016

A thought just occurred to me, perhaps the problem with the old mp is not curses, but busybox sh.

In Puppy Linux, I had /bin/sh a symlink to /bin/bash, as there were problems with some scripts. I just remembered one example:
${ABC:(-4)}
...this will extract the last 4 characters of string $ABC. Works with bash, not with busybox sh (or ash).

Anyway, my builds with Sabotage had /bin/sh linked to busybox, until I wanted to use a script with a bash-ism, so I changed /bin/sh to link to bash.
Now, I can't remember whether I tested mp with bsd-curses before or after that change.

It will be easy enough to verify. Can't do it right now, but thought I would post this, as it seems quite likely the reason for the problem with the older mp.
I'll report back.

@bkauler bkauler reopened this May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants