Giter VIP home page Giter VIP logo

lhmouse / nano-win Goto Github PK

View Code? Open in Web Editor NEW
208.0 14.0 26.0 35.52 MB

GNU nano text editor for Windows [WARNING: The master branch is constantly rebased and force-pushed so don't expect it to be steady!! -end WARNING]

Home Page: https://files.lhmouse.com/nano-win/

License: GNU General Public License v3.0

Shell 0.70% C 95.70% Makefile 0.38% Perl 0.11% M4 3.08% Batchfile 0.02%
gnu-nano text-editor console-application

nano-win's People

Contributors

aborrero avatar ak2 avatar benpicco avatar brandh avatar conan-kudo avatar cristian-caloghera avatar djc avatar dm0- avatar doughdemon avatar easyaspi314 avatar faissaloo avatar hbbroeker avatar ioistired avatar jmallach avatar kdudka avatar lhmouse avatar lionnatsu avatar look avatar marcodiegomesquita avatar matteoraso avatar mfrancis95 avatar michaliskok avatar mscalora avatar pooka109 avatar rcorsi avatar rishabh-d-dave avatar sawuare avatar tom93 avatar townba avatar vapier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nano-win's Issues

Version 4.8 binaries

Hi there. The official website for downloading the prebuilt binaries is not update: last downloadable version is 4.6 while 4.8 is the latest one. Is there any eta for the new builds to show up? In the meantime i'm trying to build from the source by myself but i'm getting troubles. I followed the readme and installed everything: MSYS2, mingw-w64-x86_64-toolchain (with everything) and base-devel. Then i download the zip source from release page, unzip it and follow the rest of the guide. When i'm in the nano-4.8 dir and launch ./configure i get the error bash: ./configure: No such file or directory. If i type autoconfig first then the ./configure command works but with errors. Now i'm trying the build_nano-win.sh as suggested in the Overview section of the readme and it's still running right now, i will report if something fails during the building but that script is not present in the zip of the 4.8 version, so i need help to build the last version from source. Thank you!

Update to nano 5.4?

Hi,

Would you consider a new binary release update to nano 5.4 "Terre des hommes" (2020 December 2 ) the benefits over 5.2 include:

"set stateflags: makes nano show the state of auto-indenting,
the mark, hard-wrapping, macro recording, and soft-wrapping in the
title bar. The flags take the place of "Modified", and a modified
buffer is instead indicated by an asterisk (*) after its name."

"set scrollercolor: the color of the indicator can be changed."

"Moving the cursor now skips over combining characters (and
other zero-width characters). Deleting a character deletes
also any succeeding zero-width characters, but backspacing
deletes just one character at a time"

Kind Regards Gavin Holt

PS I have been playing with nano 5.3 as distributed in Git for Windows 64[1] and this has worked around the sys.fork() problem. Executing and piping works and is useful. However, 272MB is a big price to pay :)

[1] https://sourceforge.net/projects/git-for-windows.mirror/files/v2.29.2.windows.2/PortableGit-2.29.2.2-64-bit.7z.exe/download

ALT GR Key behaving as ALT

I have a Portuguese (Portugal) QWERTY Keyboard and my []{}@£§€ characters are only accessible via ALT GR / CTRL + ALT and I can't type any of them because your version of nano recognizes ALT GR as the Right ALT

PS: this doesn't happen with linux/unix nano

GPL-3.0 license

Unlike LGPL, the GPL prohibits proprietary use. Windows is proprietary.

Why bother making a port to windows when the license prohibits you to do so.

Why is --noconvert CLI parameter/rc option not respected?

I've read your readme.md entrie where you wrote: + UNIX style end-of-line handling by default.

And I have no issue with it being a default, but I'm wondering what's the rationale on why can't I override it either via CLI argument or via a .nanorc set noconvert option, but still able to choose CRLF line-endings with M-D when saving a file.

Windows path convention does not work

Rather how not to install on Windows-10.

The number one most important thing to notice, is that the file paths given in the include statements, in the .nanorc HAVE to be in the POSIX format. I.e. not using the windows back-slash convention. Therefore you must write it like this:

include "C:\mybin\nano\nanorc\*.nanorc"     # Windows paths does NOT work!
include "/mybin/nano/nanorc/*.nanorc"       # This works!

At this point I have no idea if this is a bug or new development. But it surely would have helped to have known this in advance, before spending hours trying to figure out why something that used to be obvious doesn't work.

@lhmouse
Please make this clear in your README.

Key mappings

I downloaded nano-win_10050_v6.4-11-gca57881b7.7z to try it out. Some of the key mappings to commands don't seem to be working. For instance, I can't get ctrl-/ Go to Line to do anything. Also noticed when I call up the help and use the page up key, it fails. Works okay outside of help. When I try nano on a Linux system, page up works as expected at the help screen.

I have my own build of nano from the original source that uses pdcurses in place of ncurses. It's having similar problems with certain key commands and mouse actions. I'm investigating patching parts of the issue now. Thought I had the mouse working at one point, but think it only works properly with pdcurses and the SDL backend. It works intermittently with pdcurses in Win32 console mode. UTF-8 mode might work partially with pdcurses and SDL backend since there's support for drawing UTF-8 characters with SDL2. Native language support works on my version, but you have to set the environment variable for LANG to change the language. It looks for languages files in a location relative to the executable rather than hard-coding a location.

You did a really nice job porting nano and maintaining it with the latest nano updates. There's a lot of work involved in it especially after updates.

discuss config file location improvements

@lhmouse @akuropka

Following up on #42, Here are my suggestions for locations to search for the config file, we can discuss and I'll open a PR etc..

User Mode

Order Location
Primary %APPDATA%\nano\nanorc
Secondary %USERPROFILE%\.nanorc
Global %ALLUSERSPROFILE%\nano\nanorc

Admin/Elevated mode

Order Location
Primary %ALLUSERSPROFILE%\nano\elevated_nanorc
Secondary (for backcompat) %ALLUSERSPROFILE%\nanorc

%ALLUSERSPROFILE% maps to C:\ProgramData on recent versions of Windows.

GNU nano 2.7.5 released

2017 February 23

GNU nano 2.7.5 "Nijntje" can properly search and replace the \B and \b regex anchors, correctly repaints things when multiline regexes with identical start and end are involved, fixes a crash with zero-length regex matches, does replacements at the edges of a marked region right, no longer hides double-width characters at the head of softwrapped rows, displays at most three warnings at startup, and documents the ability to read a file from standard input. Come tickle my ears.

https://nano-editor.org/download.php

Recommended Installation

Please tell me how to install... I would like to enable .nanorc and execute nano.exe in posh terminal like nano sth.txt.

The last two versions of x86_64-w64-mingw32 nano.exe identify as the same revision

\nano-win_9605_v5.7-34-g387900675\pkg_x86_64-w64-mingw32\bin\nano.exe
740KB, 5/25/2021 11:03A.M.

\nano-win_9672_v5.8-44-gc04962b5e\pkg_x86_64-w64-mingw32\bin\nano.exe
740KB, 8/24/2021 11:13A.M.

The files have different CRC32's.

Both report as: v5.7-34-g387900675.

The contents of ~/share/ in both archives at the 5/25/21 11:03 files, so the banner file for the revision was not updated.

Cannot Backup To Backupdir If Set

If backupdir is set to, I think, any Windows path, Nano cannot backup to that path, but will write to the Home directory instead. Looking at the source, though not really being good at C, I think the problem lies about lines 1420 to 1430 in the files.c file. It only replaces the slashes in the path, but Windows also cannot have colons in filenames.

Why does nano editor clears the shell buffer on Windows?

Steps to repro:

  1. Install nano for windows
  2. Run some native commands in CMD or PowerShell (dir, cd etc.)
  3. Open nano: nano test.txt
  4. Close it Ctrl+X

The output of previously ran commands (step 2 above) are wiped clean.

Tested on Windows 10.

Can this be fixed?

Term environment variable error on Windows SSH

When NANO is used on "native" Windows Open SSH (Windows 10 and up) from a *nix box, this little error prevents loading nano

Error opening terminal: xterm-256color

I can change the term env variable to none

$Env:TERM = "" on powershell, for example

It works again.

This from Chocolatey package manager nano.

GNU nano from git, v7.2-14-gb7943a37a
(C) 2023 the Free Software Foundation and various contributors
Compiled options: --disable-libmagic --disable-speller --disable-nls --enable-utf8

SUGGESTION: Streamline the cross compile from linux

It is weird having a cmd file and a shell script when all can be done in linux way faster, even from WSL.

In any Ubuntu just prepare the required packages with:

sudo -E apt update && sudo apt upgrade -y
sudo -E apt install -y autoconf automake autopoint gcc mingw-w64 gettext git groff make pkg-config texinfo  p7zip-full

And then replace the contents of build_nano-win.sh with this:

#!/bin/bash -e

_host="${1:-x86_64}-w64-mingw32"
_pwd="$(cygpath -am $(pwd) || readlink -f $(pwd))"
_nproc="$(nproc)"
_prefix="$(cygpath -au $(pwd) || readlink -f $(pwd))/pkg_${_host}"

wget -c "https://invisible-mirror.net/archives/ncurses/ncurses-6.4.tar.gz"
tar -xzvf ncurses-6.4.tar.gz
patch -p1 < ncurses-6.4.patch
./autogen.sh

mkdir -p "${_pwd}/build_${_host}"
pushd "${_pwd}/build_${_host}"

mkdir -p "ncurses"
pushd "ncurses"
# Build ncurses toolchain for local host 
unset CPPFLAGS CFLAGS LDFLAGS
../../ncurses/configure --prefix="$(pwd)"  \
  --enable-{widec,sp-funcs,termcap,term-driver,interop}  \
  --disable-{shared,database,rpath,home-terminfo,db-install,getcap,echo}  \
  --without-{progs,ada,cxx-binding,manpages,pthread,debug,tests,libtool}
make -j$(($(nproc)*2))

# cross Build ncurses for destination host 
export CFLAGS="-O2 -g3"
unset CPPFLAGS 
export LDFLAGS="-static-libgcc"
../../ncurses/configure --prefix="${_prefix}"  --host="${_host}" \
  --enable-{widec,sp-funcs,termcap,term-driver,interop}  \
  --disable-{shared,database,rpath,home-terminfo,db-install,getcap,echo}  \
  --without-{progs,ada,cxx-binding,manpages,pthread,debug,tests,libtool}
make -j$(($(nproc)*2)) 
make install
popd

mkdir -p "nano"
pushd "nano"
export CFLAGS="-O2 -g3 -flto"
export CPPFLAGS="-D__USE_MINGW_ANSI_STDIO -I\"${_prefix}/include\""
export LDFLAGS="-L\"${_prefix}/lib/\" -static -flto -static-libgcc"
export NCURSESW_CFLAGS="-I\"${_prefix}/include/ncursesw\" -DNCURSES_STATIC"
export NCURSESW_LIBS="-lncursesw"
touch roll-a-release.sh  # enable use of `git describe`
../../configure  --host="${_host}" --prefix="${_prefix}"  \
  --enable-utf8 --disable-{nls,speller}
make -j$(($(nproc)*2)) 
make install-strip
popd

Then the build_package.sh could be as simple as:

#!/bin/bash -e

./build_nano-win.sh x86_64
./build_nano-win.sh i686
./package_nano-win.sh

Or you can just integrate the first two lines into package_nano-win.sh removing the need to create that third file. package_nano-win.sh would be this:

#!/bin/bash -e

./build_nano-win.sh x86_64
./build_nano-win.sh i686

_pkgversion="$(git describe --tags || echo "v0.0.0-0-unknown")"
_revision="$(git rev-list --count HEAD)"

strip -s pkg_{i686,x86_64}-w64-mingw32/bin/nano.exe
cp doc/sample.nanorc.in .nanorc
7z a -aoa -mmt"$(nproc)" --  \
  "nano-win_${_revision}_${_pkgversion}.7z"  \
  pkg_{i686,x86_64}-w64-mingw32/{bin/nano.exe,share/{nano,doc}/}  \
  .nanorc

Consider replacing the slow MSYS2 with a standard ubuntu image that can be easily converted into a GitHub Action.

My two cents. Thanks for the project.

Editing through ssh session is broken

I already got this issue with the previous version (4.6) that's why i asked in the other thread for new build but the issue i'm going to describe still persist: editing with nano through ssh session is completely broken. I mean, arrow keys doesn't work, enter key doesn't work, space doesn't work; Ctrl+x seems to work but strange chars will be printed out upon exit in the shell (�[?2004h�[?2004l). No problem with editing with local files in the Windows cmd shell. I forgot to mention that i've tried with putty and the official windows ssh client: same results in both scenarios.

Latest build identified as malware

Today I updated the nano package from 5.7-34 to 5.8-44 via scoop. After the update package file (nano-win_9672_v5.8-44-gc04962b5e.7z) downloaded, the antivirus immediately triggered,

The file C:\Users\Van-Dame\scoop\apps\nano\5.8-44\pkg_i686-w64-mingw32\bin\nano.exe is infected with Gen:Variant.Fragtor.11006 and was moved to quarantine. It is recommended that you run a System Scan to make sure your system is clean.

I ran virustotal on the package where 8 / 57 marked this as malicious (https://www.virustotal.com/gui/file/fc93c4fca5abbd80ed5b799af7753002c14c14f16989b05ab5b102fd5efbc2a5/detection).

It is highly unlikely (imo) that this package contains said malware, but the malware class identified makes me wary to install (ransomware).

Is there any binary version provided for Windows?

Hi,

I found an older version of this editor available for download in sourceforge.
I would like to request the repository maintainer to provide the binary version of the editor for new version.

Thank you.

Kind regards

TTn

Enhancement: Use same profile location for Admin as for user

99% of all PC users are only using 1 account (not counting sudo, or Administrator) accounts, while often mixing privilege escalated shells. Therefore it make no sense to have nano blindly (without telling user) that it is trying to load the .nanorc from a completely different location.

Enhancements	
    + .nanorc is loaded from "%USERPROFILE%\.nanorc" with normal privilege
      and from "%ALLUSERSPROFILE%\.nanorc" with elevated privilege.
    + Systemwide nanorc is loaded from "%ALLUSERSPROFILE%\nanorc".

ALLUSERSPROFILE   C:\ProgramData
USERPROFILE       C:\Users\<username>

nanorc not found in elevated shell

OS: Microsoft Windows [Version 10.0.22523.1000]

nano: GNU nano from git, v5.9-10-gbe0fb5d4a

ssh: OpenSSH_for_Windows_8.6p1, LibreSSL 3.3.3

When using nano in the Windows terminal in PowerShell, syntax highlighting
colors work correctly.

But in an ssh session to Windows, there are no colors.

I downloaded nano from your builds page:

https://files.lhmouse.com/nano-win/

I am using OpenSSH for Windows with the shell set to the latest PowerShell:

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.22523
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

BTW, the package in Chocolatey is ancient, and I wrote this installer script:

https://gist.github.com/rkitover/b0831d048755c7d034b0a936b2a50604

ncurses make failed

$ pwd
/c/users/administrator/desktop/nano-win/ncurses-6.0
$ ./configure
configure: loading site script /etc/config.site
/etc/config.site: line 23: config.site:23: default build_alias set to x86_64-pc-msys: command not found
/etc/config.site: line 30: config.site:30: default prefix set to /usr: No such file or directory
checking for egrep... grep -E
Configuring NCURSES 6.0 ABI 6 (Mon Feb 13 21:00:48 CST 2017)
checking for package version... 6.0
checking for package patch date... 20150808
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking target system type... x86_64-pc-msys
Configuring for msys
checking for prefix... /usr
checking for gnatgcc... no
checking for gcc... gcc
checking for C compiler default output... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for executable suffix... .exe
checking for object suffix... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking version of gcc... 4.8.3
checking for gcc option to accept ANSI C... none needed
checking $CC variable... ok
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking whether gcc understands -c and -o together... yes
checking for ldconfig... no
checking if you want to ensure bool is consistent with C++... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking if g++ works... yes
checking for g++... /d/mingw/bin/g++
checking version of /d/mingw/bin/g++... 4.8.3
checking if you want to build C++ binding and demo... yes
checking if you want to build with Ada95... yes
checking if you want to install terminal database... yes
checking if you want to install manpages... yes
checking if you want to build programs such as tic... yes
checking if you want to build test-programs... yes
checking if you wish to install curses.h... yes
checking for mawk... mawk
checking for egrep... (cached) grep -E
checking for a BSD compatible install... /d/mingw/msys/usr/bin/install -c
checking for tdlint... no
checking for lint... no
checking for alint... no
checking for splint... no
checking for lclint... no
checking whether ln -s works... yes
checking if ln -s -f options work... yes
checking for long file names... yes
checking if you want to use pkg-config... yes
checking for pkg-config... /d/mingw/bin/pkg-config
checking for /d/mingw/bin/pkg-config library directory... checking done... /d/mingw/lib64/pkgconfig
checking if we should install .pc files for /d/mingw/bin/pkg-config... no
checking if we should assume mixed-case filenames... auto
checking if filesystem supports mixed-case filenames... no
checking whether make sets ${MAKE}... yes
checking for exctags... no
checking for ctags... no
checking for exetags... no
checking for etags... no
checking for ctags... no
checking for makeflags variable...
checking for ranlib... ranlib
checking for ld... ld
checking for ar... ar
checking for nm... nm
checking for ar... (cached) ar
checking for options to update archives... -curv
checking if you have specified an install-prefix...
checking if libtool -version-number should be used... yes
checking if you want to build libraries with libtool... no
checking if you want to build shared libraries... no
checking if you want to build static libraries... yes
checking if you want to build debug libraries... yes
checking if you want to build profiling libraries... no
checking for specified models...  normal debug
checking for default model... normal
checking if you want to have a library-prefix... auto
checking for PATH separator... :
checking if you want to build a separate terminfo library... no
checking if you want to build a separate tic library... no
checking if you want to link with the GPM mouse library... maybe
checking for gpm.h... no
checking for default loader flags...
checking for an rpath option...
checking if release/abi version should be used for shared libs... auto
checking which gcc option to use... -fPIC
checking if you want to disable library suffixes... no
checking if you wish to append extra suffix to header/library paths...
checking if you wish to install ncurses overwriting curses... yes
checking if external terminfo-database is used... yes
checking which terminfo source-file will be installed... ${top_srcdir}/misc/terminfo.src
checking whether to use hashed database instead of directory/tree... no
checking for list of fallback descriptions...
checking if you want modern xterm or antique... xterm-new
checking if xterm backspace sends BS or DEL... BS
checking for list of terminfo directories... /usr/share/terminfo
checking for default terminfo directory... /usr/share/terminfo
checking if big-core option selected... yes
checking if big-strings option selected... yes
checking if you want termcap-fallback support... no
checking if ~/.terminfo is wanted... yes
checking if you want to use restricted environment when running as root... yes
checking for remove... yes
checking for unlink... yes
checking if link/symlink functions work... no
checking if tic should use hard links... no
checking if you want broken-linker support code... no
checking if tputs should process BSD-style prefix padding... no
checking if _XOPEN_SOURCE really is set... no
checking if we should define _XOPEN_SOURCE... 600
checking if SIGWINCH is defined... no
checking for nl_langinfo and CODESET... no
checking if you want wide-character code... no
checking whether to enable _LP64 definition in curses.h... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for fseeko... yes
checking whether to use struct dirent64... no
checking if you want tparm not to use X/Open fixed-parameter list... yes
checking for type of bool... auto
checking for alternate terminal capabilities file... Caps
checking for type of chtype... uint32_t
checking for type of ospeed... short
checking for type of mmask_t... uint32_t
checking for size CCHARW_MAX... 5
checking for type of tparm args... intptr_t
checking if RCS identifiers should be compiled-in... no
checking format of man-pages...  gzip
checking for manpage renaming... no
checking if manpage aliases will be installed... yes
checking if manpage symlinks should be used... yes
checking for manpage tbl... no
checking if you want to build with function extensions... yes
checking if you want to build with SCREEN extensions... yes
checking if you want to build with terminal-driver... no
checking for extended use of const keyword... yes
checking if you want to use extended colors... yes
configure: WARNING: This option applies only to wide-character library
checking if you want to use extended mouse encoding... yes
checking if you want to use extended putwin/screendump... yes
checking if you want $NCURSES_NO_PADDING code... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for signed char... yes
checking size of signed char... 1
checking if you want to use signed Boolean array in term.h... no
checking if you want SIGWINCH handler... yes
checking if you want user-definable terminal capabilities like termcap... yes
checking if you want all development code... no
checking if you want hard-tabs code... no
checking if you want limited support for xmc... no
checking if you do not want to assume colors are white-on-black... yes
checking if you want hashmap scrolling-optimization code... yes
checking if you want colorfgbg code... no
checking if you want interop bindings... yes
checking if you want to link with the pthread library... no
checking if you want reentrant code... no
checking if you want experimental safe-sprintf code... no
checking if you want wgetch-events code... no
checking if you want to see long compiling messages... yes
checking if you want to see compiler warnings...
configure: checking for gcc __attribute__ directives...
... scanf
... printf
... unused
... noreturn
checking if you want to work around bogus compiler/loader warnings... no
checking if you want to enable runtime assertions... no
checking if you want to use dmalloc for testing... no
checking if you want to use dbmalloc for testing... no
checking if you want to use valgrind for testing... no
checking if you want to perform memory-leak testing... no
checking whether to add trace feature to all models... no
checking if we want to use GNAT projects... yes
checking for gettimeofday... yes
checking if -lm needed for math functions... no
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking whether time.h and sys/time.h may both be included... yes
checking for regcomp... no
checking for regcomp in -lregex... no
checking for regcomp in -lre... no
checking for compile... no
checking for compile in -lgen... no
configure: WARNING: cannot find regular expression library
checking for regular-expression headers... no
configure: WARNING: no regular expression header found
checking for fcntl.h... yes
checking for getopt.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for math.h... yes
checking for poll.h... no
checking for sys/bsdtypes.h... no
checking for sys/ioctl.h... no
checking for sys/param.h... yes
checking for sys/poll.h... no
checking for sys/select.h... no
checking for sys/time.h... yes
checking for sys/times.h... no
checking for ttyent.h... no
checking for unistd.h... (cached) yes
checking for wctype.h... yes
checking for unistd.h... (cached) yes
checking for getopt.h... (cached) yes
checking for header declaring getopt variables... unistd.h
checking if sys/time.h works with sys/select.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking if gcc supports options to tune inlining... yes
checking for signal global datatype... volatile sig_atomic_t
checking if unsigned literals are legal... yes
checking if external errno is declared... yes
checking if external errno exists... no
checking if data-only library module links... yes
checking for getcwd... yes
checking for getegid... no
checking for geteuid... no
checking for getopt... yes
checking for getttynam... no
checking for issetugid... no
checking for poll... no
checking for putenv... yes
checking for remove... (cached) yes
checking for select... no
checking for setbuf... yes
checking for setbuffer... no
checking for setenv... no
checking for setvbuf... yes
checking for sigaction... no
checking for sigvec... no
checking for strdup... yes
checking for strstr... yes
checking for tcgetpgrp... no
checking for times... no
checking for vsnprintf... yes
checking for isascii... yes
checking if nanosleep really works... yes
checking for termio.h... no
checking for termios.h... no
checking for unistd.h... (cached) yes
checking for tcgetattr... no
checking for vsscanf function or workaround... vsscanf
checking for working mkstemp... no
checking whether setvbuf arguments are reversed... no
checking for intptr_t... yes
checking for ssize_t... yes
checking for type sigaction_t... no
checking declaration of size-change... no
checking for memmove... yes
checking if poll really works... no
checking for va_copy... yes
checking for __va_copy... yes
checking for pid_t... yes
checking for unistd.h... (cached) yes
checking for vfork.h... no
checking for fork... no
checking for vfork... no
checking for openpty in -lutil... no
checking for openpty header... no
checking if we should include stdbool.h... yes
checking for builtin bool type... no
checking for library stdc++... no
checking whether /d/mingw/bin/g++ understands -c and -o together... yes
checking how to run the C++ preprocessor... /d/mingw/bin/g++ -E
checking for typeinfo... yes
checking for iostream... yes
checking if iostream uses std-namespace... yes
checking if we should include stdbool.h... (cached) yes
checking for builtin bool type... yes
checking for size of bool... unsigned char
checking for special defines needed for etip.h...
checking if /d/mingw/bin/g++ accepts parameter initialization... no
checking if /d/mingw/bin/g++ accepts static_cast... yes
checking for gnatmake... no
checking for library subsets... ticlib+termlib+ext_tinfo+base+ext_funcs
checking default library suffix...
checking default library-dependency suffix... .a
checking default object directory... objects
checking c++ library-dependency suffix... .a
checking if linker supports switching between static/dynamic... yes
checking where we will install curses.h... ${prefix}/include
checking for src modules... ncurses progs panel menu form
checking for tic... /d/mingw/msys/usr/bin/tic
checking for defines to add to ncurses6-config script...  -D_XOPEN_SOURCE=600
package: ncurses
configure: creating ./config.status
config.status: creating include/MKterm.h.awk
config.status: creating include/curses.head
config.status: creating include/ncurses_dll.h
config.status: creating include/termcap.h
config.status: creating include/unctrl.h
config.status: creating man/Makefile
config.status: creating include/Makefile
config.status: creating ncurses/Makefile
config.status: creating progs/Makefile
config.status: creating panel/Makefile
config.status: creating menu/Makefile
config.status: creating form/Makefile
config.status: creating test/Makefile
config.status: creating misc/Makefile
config.status: creating c++/Makefile
config.status: creating misc/run_tic.sh
config.status: creating misc/ncurses-config
config.status: creating man/ncurses6-config.1
config.status: creating Makefile
config.status: creating include/ncurses_cfg.h
Appending rules for normal model (ncurses: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (ncurses: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for normal model (progs: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (progs: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for normal model (panel: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (panel: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for normal model (menu: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (menu: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for normal model (form: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (form: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for normal model (test: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (test: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for normal model (c++: ticlib+termlib+ext_tinfo+base+ext_funcs)
Appending rules for debug model (c++: ticlib+termlib+ext_tinfo+base+ext_funcs)
creating headers.sh

** Configuration summary for NCURSES 6.0 20150808:

       extended funcs: yes
       xterm terminfo: xterm-new

        bin directory: /usr/bin
        lib directory: /usr/lib
    include directory: /usr/include
        man directory: /usr/share/man
   terminfo directory: /usr/share/terminfo

$ make
cd man && D:/mingw/bin/make DESTDIR="" RPATH_LIST="/usr/lib" all
make[1]: Entering directory 'C:/users/administrator/desktop/nano-win/ncurses-6.0/man'
D:/mingw/msys/usr/bin/sh.exe ./MKterminfo.sh ./terminfo.head ./../include/Caps ./terminfo.tail >terminfo.5
make[1]: Leaving directory 'C:/users/administrator/desktop/nano-win/ncurses-6.0/man'
cd include && D:/mingw/bin/make DESTDIR="" RPATH_LIST="/usr/lib" all
make[1]: Entering directory 'C:/users/administrator/desktop/nano-win/ncurses-6.0/include'
cat curses.head >curses.h
D:\mingw\bin\make.exe: Interrupt/Exception caught (code = 0xc0000005, addr = 0x00007FFE6111FE04)
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 255

I build it by MinGW-w64, What is the reason? thank you very much!

Pasting from clipboard instead of cutbuffer?

Is this supported, or am I missing something?

Expected:

  • Copy something outside nano
  • Paste with ^U or ^V or ^Insert
  • Copied text gets pasted

Occurred:

  • Copy something outside nano
  • Paste with ^U or ^V or ^Insert
  • Error: "Cutbuffer is empty"

PowerShell sometimes crashes when starting nano

I "installed" nano-win_9232_v5.2-4-ge724fdcb on Windows 10 Pro 19041.572 by unzipping it, copying the nano-win_9232_v5.2-4-ge724fdcb directory to C:\Program Files, removing the i686-w64-mingw32 subdirectory (keeping x86_64-w64-mingw32), and adding C:\Users\user\Downloads\nano-win_9232_v5.2-4-ge724fdcb\x86_64-w64-mingw32\bin to the system Path environment variable.

If I run "nano.exe" or "nano" from powershell 5.1.19041.546 in my user (non-admin account) home directory, sometimes nano runs just fine, and sometimes PowerShell crashes before I can see the nano "screen" come up. Try repeatedly running nano and exiting to reproduce the issue. If it helps any, I typically run PowerShell maximized on a 1920x1080 monitor.

I do not experience the same issue when running nano from the Command Prompt.

Syntax Highlighting

I've seen that Nano supports syntax highlighting by default, but when I try opening a simple .py file with nano, no syntax highlighting is applied.

FAQ: Where is the "positionlog" file located?

Would be great to know where the file cursor position file is located as enabled by the set positionlog flag.

Also, what is the following location doing?

-o <dir> --operatingdir=<dir> Set operating directory

Non-English Characters

Thanks for the great port. It works quite well on my Windows 10 except non-English characters.

When i press a non-English character, nano did not print the char.

Support italics

Nano has had italic and bold support since 5.0. But when specifying italic in any syntax highlighting file, the text doesn't become italic.

Surprisingly, MSys2's nano doesn't have this problem.

../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’

$ ./build_nano-win.sh
[omit succeeding output]
gcc -DHAVE_CONFIG_H -I../ncurses -I. -I../../../ncurses-6.2/ncurses -I../include -I../../../ncurses-6.2/ncurses/../include -D__USE_MINGW_ANSI_STDIO -DHAVE_NCURSESW_NCURSES_H                   -I"C:/Users/samuel/repos/test_repos/nano-win/pkg_x86_64-w64-mingw32/include" -I"C:/Users/samuel/repos/test_repos/nano-win/pkg_x86_64-w64-mingw32/include/ncursesw" -D_XOPEN_SOURCE=600 -DNDEBUG -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN -DUSE_WIN32CON_DRIVER -O2 -pthread --param max-inline-insns-single=1200 -c ../../../ncurses-6.2/ncurses/base/lib_beep.c -o ../objects/lib_beep.o
In file included from ../../../ncurses-6.2/ncurses/tty/hashmap.c:71:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
In file included from ../../../ncurses-6.2/ncurses/tty/hardscroll.c:149:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:983: ../objects/hardscroll.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:987: ../objects/hashmap.o] Error 1
.. adding -P option to work around gcc 10.2.0
.. adding -P option to work around gcc 10.2.0
In file included from ../../../ncurses-6.2/ncurses/base/lib_addch.c:37:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:991: ../objects/lib_addch.o] Error 1
In file included from ../../../ncurses-6.2/ncurses/base/lib_addstr.c:46:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:995: ../objects/lib_addstr.o] Error 1
In file included from ../../../ncurses-6.2/ncurses/base/lib_beep.c:44:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:999: ../objects/lib_beep.o] Error 1

nano not working on Win11

Seems after an update to the version, nano doesn't launch anymore? I've got the issue on 2 PCs - Both popup 'The code execution cannot proceed because libmcfgthread-1.dll was not found'. Reinstall didn't help.

Display collapses when the window is resized

On windows terminal, display collapses when the window is resized.
(wsl nano works well even if I resize.)

  • half window

image

  • resize into full (win + arrow up)

image

  • then resize into half window

image

Error expanding @PKGDATADIR@

Hi,

I uncommented the following line in my .nanorc

include "@PKGDATADIR@/*.nanorc"

but nano gives the error

Error in C:\Users\RashilGandhi/.nanorc on line 237: Error expanding @PKGDATADIR@/*.nanorc: No such file or directory

Mouse support

Hello,

I enabled mouse support int the .nanorc file, but it is not working for me inside the console.
Is this behavior intended or is this a bug?

Regards
Andi

Not supported on Windows yet

Hi

Nano may just be the sweet spot for 95% of my editing needs - I am a non-compiling windows user!

I like a portable installation on my USB stick and have a batch file to load nano.exe - below.

As the key bindings were unfamiliar I have used AutoHotKey to translate (also sends mouse wheel and paste from windows clipboard) - below.

With the simple things done I have run in to the "Not supported on Windows yet" message with the following commands:

linter
I would love to call the Lua linter - LuaCheck.exe
https://github.com/mpeterv/luacheck

execute: In order to cut/copy to the windows system clipboard I would like to invoke clip.exe with the contents of the nano cutbuffer. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/clip
In order to run the file/script I am editing I would like to invoke shelexec.exe with the current filename. http://www.naughter.com/shelexec.html
In order to manipulate blocks of text I would like to pipe the current selection to a Lua script and insert the returned text.

speller: I use a windows compiled version of hunspell.exe - could this be called from nano-win? https://github.com/iquiw/hunspell-binary/releases/tag/v1.7.0

I guess the execute command is the key to all of these limitations, is there any chance of nano-win being patched to enable execute, flippipe, flipexecute, flipnewbuffer?

Very grateful for any insights, and many thanks for posting binary releases of nano-win (https://files.lhmouse.com/nano-win/) for us mere mortals.

Kind Regards Gavin Holt

nano.bat:

@echo off
REM Run Nano as a portable application
REM See autohotkey for keyboard reassignment

REM Change to this batch directory
CD /D %~dp0

REM Maximise console size
tools\cmdmax.exe

REM Use a color theme
tools\colortool.exe -q tools\themes\textadept.ini

REM Set title so autohotkey can find it!
title nano.exe

REM Run with local rc file
REM nano.exe --rcfile=nano.rc %*

exit

autohotkey script:

; Nano enhancements
#If WinActive("Administrator: nano.exe") or WinActive("nano.exe")
{
; --zap is set
;
^':: Send ''{Left}
^2:: Send ""{Left}
^9:: Send (){Left}
^0:: Send (){Left}
^[:: Send []{Left}
^]:: Send []{Left}
^5:: Send %%{Left}
^+[:: Send {{}{}}{Left}
^+]:: Send {{}{}}{Left}
^TAB::Send !.
^+TAB::Send !,
^Up::Send !q
^Down::Send !w
WheelUp::Send ^p^p^p
WheelDown::Send ^n^n^n
^a::Send ^{Home}+^{End} ; Select all
^b::Send ^a ; BOL
!b::return ; disable invoke linter
^+b::Send +{Home} ; Select BOL
^c::Send !6 ; Copy to local cutbuffer
; ^d::return ; disable del, Can't find a way to duplicate block
; ^e:: Built in :) ; EOL
+^e::Send +{End} ; Select EOL
^f::Send ^w ; Find text
+^f::Send ^/ ; Find RE
^g::Send ^_ ; Goto
^h::Send ^\ ; Replace
^!i::Send ^r ; Insert file
^j::Send !] ; Jump brackets
!j::return ; disables justification
^+j::return ; disables justification
^k::Send +{End}{Backspace} ; kill right
^+k::Send +^a{Del} ; kill left
^l::return ; disable centre line
!l::return ; disables toggle hard wrapping
^m::Send !a ; set/unset mark
^n::Send ^t{Enter} ; Execute not supported - but used to make a new buffer
^o::Send ^r^t ; Open browser
!o::^o ; Export selection or whole file
^p::Send ^u ; Paste
^q::Send !3 ; Line quotes
^r::return ; disable read, Can't work out how to revert to file copy
; ^s:: Built in :) ; Complains if backup set
^t::return ; disable execute
!t::return ; disable cutting to end of file
^v::^u ; Paste from local cutbuffer
^RButton:: SendInput {RAW}%ClipBoard% ; Paste from system buffer
^w::Send ^x ; Close
^x::Send ^k ; Cut to local cutbuffer
^y::Send !{Del} ; Delete sel or line
^z::Send !u ; Undo
^+z::Send !e ; Redo
Esc::Send {F12} ; Will be interpreted using bindings in nano.rc
F2::Send !{PgDn} ; Next bookmark
^F2::Send !{Ins} ; Toggle bookmark
+F2::Send !{PgUp} ; Previous bookmark
^/::^t
^Enter::^] ; Complete word
}

nano.rc:

set atblanks
set autoindent
unset backup
unset backupdir "..\zBackup"
set brackets ""')>]}"
unset constantshow
set fill -8
set linenumbers
set matchbrackets "(<[{)>]}"
set mouse
set multibuffer
set nohelp
set numbercolor white,black
set indicator
set positionlog
set punct "!.?"
set quickblank
set showcursor
set smarthome
set softwrap
set tabsize 4
set tabstospaces
set trimblanks
set zap

include "properties/awk.nanorc"
include "properties/batch.nanorc"
include "properties/css.nanorc"
include "properties/cmake.nanorc"
include "properties/default.nanorc"
include "properties/html.nanorc"
include "properties/ini.nanorc"
include "properties/javascript.nanorc"
include "properties/lua.nanorc"
include "properties/makefile.nanorc"
include "properties/markdown.nanorc"
include "properties/moonscript.nanorc"
include "properties/sed.nanorc"
include "properties/text.nanorc"
include "properties/vi.nanorc"

bind F12 cancel all
bind F12 exit main
bind F12 exit browser
bind F12 exit help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.