11 ms·
GNU Nano 4.0
- l24ztj 8y ago>A newline character is no longer automatically added at end of buffer. yesssssssssss
- emilfihlman 8y agoThis has been a configurable option since forever.
- tyingq 8y agoSane defaults still have value.
- OJFord 8y agoMany would say the old behaviour was the sane choice - apart from anything else it's consistent with vi(m) and git.
- tyingq 8y agoI suppose. Though you might expect a GNU editor to follow Emacs for this behavior.
- nemetroid 8y agoThe old behaviour is the sane default, at least for editing text files. POSIX defines a text file as a file consisting of a number of lines, each terminated by an LF character.
- coldtea 8y agosane is what the user expects, not what POSIX demands.
- lexicality 8y agoOne could reasonably expect that a user expects a POSIX system to behave according to the POSIX standards?
- williamdclt 8y agoNot really, most users (even tech people) don't know that it is a POSIX standard, or what's a POSIX standard, or what's POSIX really
- lexicality 8y agoAre you thinking about most people who use a computer or most people who use a CLI based editor that's presumably on a remote machine they just sshed into?
- coldtea 8y agoI'd say both sets. Hardly any of my colleagues knows what POSIX is (and surely not in any depth, even those that do), but they still SSH and use editors that include Vim all the time... I'd say in a company of 50+ SSHing people, around 5-6 know POSIX and its history, and usually the older ones (35+).
- unveres 8y agoI think it's better to expect more from a specialist than less. ;)
- coldtea 8y agoA sysadmin maybe. A user hardly. Especially a 2019 user, 20+ years removed from the systems, decisions, and rationales, behind POSIX. Just try to get someone (even a seasoned Linux user) to use a POSIX-only userland (as opposed to GNU), as see how fast they'll be pulling their hair out...
- unveres 8y ago
- marcosdumay 8y agoIf I would bother configuring an editor I would not be using nano.
- lexicality 8y agoGenuinely curious, why do you see this as a good change?
- saagarjha 8y agoThere are programs that violate POSIX and are picky about it.
- lexicality 8y agoWhich ones?
- dfox 8y agoPOSIX definition of what is text file actually requires the file to end with \n, so such programs are technically correct. The reason why this is (and also why the lines should not be longer than LINE_MAX or contain \0) is that when you simply call fgets() in a loop with LINE_MAX sized buffer, all of these things cause perfectly logical, but wrong/surprising behavior. This is the reason why almost any modern small unix tool contains something called myfgets(), getline() or whatever which wraps fgets() in loop with realloc() and correctly distinguishes eof from other errors.
- saagarjha 8y ago> POSIX definition of what is text file actually requires the file to actually end with \n, so such programs are technically correct. No, they’re not correct, since they make files without the newline.
- l24ztj 8y agoBecause if I type "hello" in a document, I expect the editor to save "hello", not "hello\n".
- lexicality 8y agoWhere did you get that expectation? Every editor I've used up until Visual Studio Code did that by default. (I was actually very surprised when vscode _didn't_ do this!)
- mruts 8y agoSuch an insane default. Currently programming a bittorrent client and was edited files to test some functionality. Was confused for a long time until I realized nano was turning my "echo 'this is a test' > test" into "echo 'this is a test\n' > test"
- symlinkk 8y agoFunny you mention echo, which prints a newline by default as well.
- lexicality 8y agoPretty sure nano was changing your code to echo 'this is a test' > test\n and then echo was adding the newline because you didn't specify -n.
- pushpop 8y ago...and also echo 'this is a test\n' doesn't produce an additional new line because -e wasn't specified.
- nemetroid 8y agoRunning "echo 'this is a test' > test" produces a file with a newline at the end.
- mmastrac 8y ago"nano" is an interesting creature - it was originally developed as a replacement for the "pico" command that shipped with "pine" (an amazing curses-based email client) because the license on pico was just not really clear. I still use nano 50% of the time because it's so easy to jump into a file, make some quick changes, and jump out. Plus the mark/cut/paste keystrokes are seared into my memory after years of use.
- simias 8y agoBeing an Emacs user I use Zile for that since it's effectively a trimmed-down version of Emacs. Of course unlike nano it's not usually installed by default on most distros, so I still have to use nano or vi from time to time, but I can't say I enjoy it very much.
- komon 8y agoI often reach for emacs -nw -Q It boots up quickly and the basic editing defaults are all there. Has the advantage of being everywhere Emacs already is as well
- mruts 8y agoI like mg as an emacs-like editor that is simple and quick. Made by the great OpenBSD folks and is of great quality with good documentation.
- wglb 8y agoActually made by David G Conroy while he was at Mark Williams, and open sourced. I kicked around to various folks and ended up in the gnu fold.
- spudlyo 8y agoIf I want a light version of emacs (like on OpenWRT, or a constrained embedded device) I reach for JOVE, or Jonathan's Own Version of Emacs. JOVE was actually the version of emacs I first learned on back in the late 80s. JOVE is tiny, and has implemented a huge amount of emacs. After you spend 15 minutes or so tweaking your .joverc file you won't even notice it's not GNU.
- tofflos 8y agoIt's too bad the Windows Store only contains Ubuntu LTS editions. It'll be July 2020 before all the improvements from 2.9.3 on up become available for most WSL users. :(
- AlexeyBrin 8y agoNo need to wait until 2020. From the GNU nano README: ------------------------------- How to compile and install nano: Download the nano source code, then: tar xvzf nano-x.y.z.tar.gz cd nano-x.y.z ./configure make make install It's that simple. Use --prefix with configure to override the default installation directory of /usr/local. If you haven't configured with the --disable-nanorc option, after installation you may want to copy the doc/sample.nanorc file to your home directory, rename it to ".nanorc", and then edit it according to your taste.
- Moto7451 8y agoThis indeed. This is one of my first steps on any new computer/OS install. I’m a daily Nano user and in my experience the only real headache you can run into is missing the right version or configure not finding where readline and nucrses/ncursesw are. Those are really easy to install on any platform (even from source).
- marvy 8y agoJust download an LTS and then run do-release-upgrade. (May have to tweak /etc/update-manager/release-upgrades)
- tyingq 8y agoYou can also convert an existing distro so it side loads into WSL: https://docs.microsoft.com/en-us/windows/wsl/build-custom-distro https://docs.microsoft.com/en-us/windows/wsl/build-custom-di...
- giancarlostoro 8y ago> It's too bad the Windows Store only contains Ubuntu LTS editions. It'll be July 2020 before all the improvements from 2.9.3 on up become available for most WSL users. :( There are other Linux distros too. I had openSUSE installed off there not too long back. Theres even Github projects that let you install any ISO onto WSL and wherever on your hard drive you want to install them to.
- roschdal 8y agohttps://idioms.thefreedictionary.com/rope+of+sand https://idioms.thefreedictionary.com/rope+of+sand
- xeeeeeeeeeeenu 8y ago>An overlong line is no longer automatically hard-wrapped. Finally. It was one of the most insane defaults in the history of text editors. Things like this are the reason why it's so hard to recommend nano to beginners.
- deleted 8y ago[deleted]
- interfixus 8y agoOh yes. Got severely burned a couple of times by config files riddled with mysterious errors. Php.ini was never truly happy with the second half of every other comment suddenly posing as code.
- unveres 8y agoI like the idea of hard wrap, line of code shouldn't be longer than 80 characters... sure it's confusing for beginners + sometimes data shouldn't be hard-wrapped, but in general (imho) it's better than worse
- NullPrefix 8y agoSo error out in your parser that uses those files.
- r3bl 8y agoNano is a text editor, not an IDE. There's no reason why every text (not just code) should contain less than 80 characters in every line.
- unveres 8y agoGood point! I guess I didn't think it through ;)
- opan 8y agoCan you explain your thought process here? I believe the idea is that old terminals were 80 characters wide. Also, even with modern monitors it can be nice to have shorter lines so you don't have to move your eyes/head as much. I can't think of why the rule would be specific to source code or why it would apply any differently to other forms of text.
- sscarduzio 8y agoIt's amazing how, no matter how old or small a piece of software is, as long as it keeps being used, itremains a living thing and keeps on changing and evolving.
- blattimwind 8y agoFor a stable piece of software the build script(s) somehow turn into a change hotspot. You might have not touched the core of the software in five years, but guess what, every couple months some change to the build script is necessary.
- saagarjha 8y agoDepends on how much nonstandard stuff you’re using, and whether you have flags such as -Werror that can cause “new” build failures.
- blattimwind 8y agoAnd on how many platforms the software is used. E.g. when people try to compile things on HP-UX, perhaps even an older version, things often get interesting.
- geuszb 8y agoI'm sure nano/pico and the like are nice but to me there's two things a terminal editor can try to solve for: being nice, or bring ubiquitous. The nicest ones (say emacs) are way nicer than nano in terms of features, extensibility, etc. Now for being ubiquitous, nothing beats vi to date. I can't tell what nano is aiming for? EDIT I guess I had assumed that vi/vim was significantly more widespread than nano. Maybe that's an outdated assumption? I feel like I've come across a few instances where vi has been the only choice...
- tyingq 8y agoNano is somewhat ubiquitous in that it's the default editor on many Linux distros, including both Debian and Ubuntu. I often run "crontab -e" or "git commit" and end up in nano because I forgot to set $EDITOR on a new Linux box. Edit: I suspect it's the default because it launches with visible instructions on how to exit. Launching Vim or Emacs strands a lot of new users.
- ChrisSD 8y agoIndeed. Never underestimate how important exiting is: https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/ https://stackoverflow.blog/2017/05/23/stack-overflow-helping...
- lern_too_spel 8y agoVi is ubiquitous. Vim is not.
- faissaloo 8y agoDoes anyone have an Ubuntu PPA with up to date versions of GNU Nano?
- fevangelou 8y agoHere's a bash script to install Nano Editor v4.0 with syntax highlighting enabled on the Mac (should work as-is on Ubuntu, Fedora etc. as well)... https://gist.github.com/fevangelou/be744753730e86b8783fd481f311a7c9 https://gist.github.com/fevangelou/be744753730e86b8783fd481f...
- thom 8y agoSerious question: how often do you log into a box where it would be impossible or considered rude for you to install a proper editor? I feel like I must have been blessed by the sysadmins in my life (them often being me) but it's never happened in 25 years of logging into *nix boxes.
- morganvachon 8y agoA lot of my side work involves fixing things for companies and individuals who use a cheap shared hosting plan from a bottom-barrel reseller. Often this is a virtual host in cPanel/WHM or Plesk and is very limited on what you can install outside of Fantastico, Softaculous, or similar web app stores. In those situations I normally have to deal with extremely restricted SSH access (if any at all) and can't install unapproved software. It's frustrating but it does happen frequently.
- thom 8y agoGotcha, never been in that position, but I feel your pain.
- theonemind 8y agoIn any large-ish organization, you probably don't do this on a production machine. You absolutely do not do it if you aren't the person (or on the team) who will get called/paged if it breaks, or you're probably risking your job if the package manager goes sideways or you flub it up and let the package manager throw in a couple of extra upgrades or whatever.
- thom 8y agoSo you ask that team to install Emacs (because you're less likely to mess up config with a proper/familiar editor) and they just say no, forever?
- theonemind 8y agoProbably, yes. If you're lucky, it might get rolled into the next deploy/upgrade. Luckily, you usually don't need to do extensive editing there, because you usually can't change much. Most of the changes you'd want to make to config files, etc. also have to go into the next deploy or through some change management process anyway. You definitely get used to using vi, though.
- mixmastamyk 8y agoThere needs to be a console text editor installed by default with CUA keybindings, like notepad, sublime text, dos edit, and borland tools were back in the day. Nano can get partially there, micro is the current best though it has a few MacOS oddities around home/end but can be configured, in the past used ne.
- lbruder 8y agomcedit, the editor of mc, is a nice DOS-like editor, complete with blue background and pulldown menus. The mc suite contains a simple but powerful hex editor, too.
- programmerzdojo 8y agowhat are new features as compared to sublimetext?
- pvtmert 8y agoDid anyone noticed that date at the top right is 2018?