bugGNU nano - Bugs: bug #48751, 2.6.3 fails to build on OS X:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #48751: 2.6.3 fails to build on OS X: undeclared identifier 'TIOCLINUX'

Submitter:  Andrew Ho <andrewgho>
Submitted:  Wed 10 Aug 2016 06:51:58 PM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Fri 02 Sep 2016 07:37:34 AM UTC, comment #10: 

Released in 2.7.0.  Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Sun 14 Aug 2016 07:47:01 PM UTC, comment #9: 

(Ehm... the commit is: 928a24c -- I shouldn't quote these things before having merged and pushed.)

Benno Schulenberg <bens>
Group administrator
Sun 14 Aug 2016 07:33:06 PM UTC, comment #8: 

(The compilation issue is fixed in git, 0d5f210.)

Andrew Ho wrote:

> Under both iTerm2 and Terminal, when I press Option+Arrow
> in any direction, those appear to be treated just as regular
> arrow key presses (that is, I move one unit in those directions,
> and there is no other error message indicated).


And that is with the Esc+ setting (in the Preferences) for the Option key?  And with any other setting too?

If so, please compile nano with --enable-debug, and run 'src/nano 2>TRAIL', press Left, Right, Up, Down, and then the same keys again while holding Option.  Then do 'grep -A6 "hex codes" TRAIL', and post the result.

Benno Schulenberg <bens>
Group administrator
Thu 11 Aug 2016 07:57:27 PM UTC, comment #7: 

Whether Command works as Meta depends on the configuration, but, by default, both iTerm2 and Terminal use Esc for Meta instead of Command (because things like Command+V or Command+W have OS wide meanings under OS X, in those cases, Paste or Close). In my case, Esc is Meta, so I did Esc, Option+Left, Enter; etc.

On iTerm2:

^[^[[D
^[^[[C
^[^[[A
^[^[[B

On Terminal:

^[^[[D
^[^[[C
^[^[[A
^[^[[B

Andrew Ho <andrewgho>
Thu 11 Aug 2016 07:27:23 PM UTC, comment #6: 

Thanks for confirming.  Patch will appear in 2.6.4.

About the keys...  If I understand correctly, on an Aplle the Command key works as Meta?  So Command+X toggles the help lines?  If so, then please type the following series:

Command+V  Option+Left  Enter
Command+V  Option+Right  Enter
Command+V  Option+Up  Enter
Command+V  Option+Down  Enter

Then copy and paste the result.  (If the normal system Terminal is something else than iTerm2, then please for each of them.)

Benno Schulenberg <bens>
Group administrator
Thu 11 Aug 2016 05:17:44 PM UTC, comment #5: 

I can also confirm that the patch fixes the compilation error on OS X, thanks!

OX by default maps Ctrl+Arrow keys to workspace management functions (Ctrl+Up shows all desktops, Ctrl+Down shows all windows, Ctrl+Left and Ctrl+Right moves desktops), so most OS X users can't/won't use those shortcuts. Similarly, Option+Right maps to End on my keyboard, and so forth.

I did test that if I explicitly disable Ctrl+Arrow key shortcuts in Control Panel, and use nano within an iTerm window, then all of the Ctrl+Arrow nano shortcuts work. For some reason, within a normal system Terminal window, Ctrl+Left and Ctrl+Right work, but Ctrl+Up and Ctrl+Down don't (same TERM=xterm-256color).

Andrew Ho <andrewgho>
Thu 11 Aug 2016 04:39:21 PM UTC, comment #4: 

Yep, I mean it's compiling fine with your patch.

About the Option+Up or Down I may have a changed something in iTerm2's preferences because it displays "[Unknown Sequence]" in nano when I try those shortcuts.

Frank Wolff <frank38>
Thu 11 Aug 2016 02:01:20 PM UTC, comment #3: 

Hi Frank,

You mean it's compiling fine with the patch applied?

No, there is no test to be done -- the patch just disables a part of the code that isn't needed on a Mac.

What I am curious about, though, is: do the Option+UpArrow and Option+DownArrow do a Home and an End in nano?  Is that the expected behavior?  Is that how those keys behave in other applications in iTerm2 too?  (I ask, because these keys then don't do what they do on Linux: jump to the previous/next block of text.)

Benno Schulenberg <bens>
Group administrator
Thu 11 Aug 2016 12:49:48 PM UTC, comment #2: 

Hi,

I confirm that it's compiling and working fine so far. Is there any specific test to do ?

Frank Wolff <frank38>
Thu 11 Aug 2016 10:44:51 AM UTC, comment #1: 

Thanks for reporting.  I didn't know how to conditionalize that part of the code, so I decided to push it put to get some feedback...

Googling a bit harder brought me to the attached patch.  Please try and see if that solves the compilation issue on OS X.

(file #38173)

Benno Schulenberg <bens>
Group administrator
Wed 10 Aug 2016 06:51:58 PM UTC, original submission:  

Starting with release 2.6.3, building GNU nano under OS X fails when compiling winio.c because of a Linux specific ioctl() constant:

gcc -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/usr/local/share/locale\" -DSYSCONFDIR=\"/usr/local/etc\"   -g -O2 -Wall -MT winio.o -MD -MP -MF .deps/winio.Tpo -c -o winio.o winio.c
winio.c:513:15: error: use of undeclared identifier 'TIOCLINUX'
        if (ioctl(0, TIOCLINUX, &modifiers) >= 0 && (modifiers & 0x04)) {
                     ^
1 error generated.
make[2]: * [winio.o] Error 1
make[1]: * [all-recursive] Error 1
make: * [all] Error 2

The build environment is OS X El Capitan, with latest XCode:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Release 2.6.2 and earlier build cleanly under the same environment (commit 290d278f appears to be the introduction of this bug).

Andrew Ho <andrewgho>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by frank38 (Posted a comment)
  • -email is unavailable- added by bens (Updated the item)
  • -email is unavailable- added by andrewgho (Submitted the item)
  • -email is unavailable- added by andrewgho (Nano commit 290d278f breaks OS X)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-02 bens Open/ClosedOpen Closed
    2016-08-14 bens StatusIn Progress Fixed
    2016-08-11 bens Severity3 - Normal 4 - Important
        StatusNone In Progress
    2016-08-11 bens Attached File- Added 0001-input-try-looking-at-the-keyboard-state-only-when-co.patch, #38173
        Assigned toNone bens
        SummaryNano 2.6.3 build fails on OS X undeclared identifier 'TIOCLINUX' 2.6.3 fails to build on OS X: undeclared identifier 'TIOCLINUX'
    2016-08-10 andrewgho Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code