# micro editor without syntax highlighting



## gotnull (Oct 15, 2022)

Hi guys,

I use a text editor called editors/micro, problem it seems that the current version doesn't have any syntax highlighting.
So I wonder if it is just me or if it is a bug in the FreeBSD's package, I know that the Linux's version runs okay. 
I installed it via pkg (I do not compile software), the system is on 13.1 stable not latest.
I checked my shell settings and nothing should interfere, and to be sure I installed neovim to compare and it does use syntax highlighting so I do not think my settings are wrong, beside I temporary changed the shell just in case but the problem persisted.
Can a micro user confirm this ?
Thank you 


```
~ : freebsd-version -kru
13.1-RELEASE-p2
13.1-RELEASE-p2
13.1-RELEASE-p2
```


```
~ : doas pkg info micro
micro-2.0.11_2
Name           : micro
Version        : 2.0.11_2
Installed on   : Tue Oct 11 22:27:46 2022 CEST
Origin         : editors/micro
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : editors
Licenses       : MIT
Maintainer     : lcook@FreeBSD.org
WWW            : https://micro-editor.github.io/
Comment        : Modern and intuitive terminal-based text editor
Options        :
    DEBUG          : off
    DOCS           : on
Annotations    :
    FreeBSD_version: 1301000
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 11.1MiB
Description    :
Micro is a terminal-based text editor that aims to be easy to use and
intuitive, while also taking advantage of the full capabilities of modern
terminals.

WWW: https://micro-editor.github.io/
```


----------



## rorgoroth (Oct 15, 2022)

Can you try the binary provided by https://github.com/zyedidia/micro/releases/tag/v2.0.11 ?

A few months back on my dev container running alpine micro suddenly lost all syntax highlighting support but the binary from github worked fine, a few weeks later I saw micro get updated and tried the system one again and syntax highlighting worked fine.

Taking a quick look at their git history this commit looks promoising: https://git.alpinelinux.org/aports/...o?id=20d1a8722b5600f9d3d6d341484ca4c135b284ce

You should cross reference that with the freebsd ports file to see if it issues the extra build command.


----------



## T-Daemon (Oct 15, 2022)

Not a editors/micro user but I had a look at the problem. It could be a bug. Not sure if it's on FreeBSD side or upstream. The port comes with a lot of source files (see ports/editors/micro/distinfo).

According to /usr/local/share/doc/micro/README.md:


> ### Colors and syntax highlighting
> 
> If you open micro and it doesn't seem like syntax highlighting is working, this is probably because
> you are using a terminal which does not support 256 color mode. Try changing the color scheme to `simple`
> ...



I tried changing the colorschem, checked TERM=xterm-256color, run micro in x11/rxvt-unicode, x11/xterm, x11/xfce4-terminal, no syntax highlighting.

If a syntax file is placed under ~/.config/micro/syntax/, syntax highlighting works for that file type.

For example sh.yaml:




That file overrides the build-in syntax file (they can be viewed from the binary, even documentation is compiled into the binary: `strings /usr/local/bin/micro | less` )

You should open a PR.


----------



## gotnull (Oct 15, 2022)

rorgoroth said:


> Can you try the binary provided by https://github.com/zyedidia/micro/releases/tag/v2.0.11 ?


omg I am sorry I forgot this !
You won't believe it, I've already downloaded the binary earlier today then I don't know what happened after that ? I guess my mind went somewhere, I don't know where exactly but it seems to be a place far but really far away 
Thank you rorgoroth for the reminder 

So I tried the binary and it works fine.
freebsd pkg provides the version: 2.0.11_2 (22.10.06)
the micro git repo provides the version: 2.0.11 (22.08.01)



T-Daemon said:


> I tried changing the colorschem, checked TERM=xterm-256color, run micro in x11/rxvt-unicode, x11/xterm, x11/xfce4-terminal, no syntax highlighting.


Yep I almost did the same before opening the thread with the same result, that confirms something is wrong with the package I guess.



T-Daemon said:


> If a syntax file is placed under ~/.config/micro/syntax/, syntax highlighting works for that file type.


I tried it with the Freebsd package, put all the syntax files into the dedicated dir, and it worked too, nice catch T-Daemon !



T-Daemon said:


> You should open a PR.


I am not sure to follow, you mean report the bug on the Freebsd's bugzilla ? or really a PR ?


----------



## T-Daemon (Oct 16, 2022)

gotnull said:


> I am not sure to follow, you mean report the bug on the Freebsd's bugzilla ? or really a PR ?


Sorry for expressing myself not clearer.  I meant report the bug on the FreeBSD's bugzilla. Here in forums PR (Problem Report) is mostly used as a term for bug reports.


----------



## gotnull (Oct 16, 2022)

No problem you probably express yourself better than me, next time I'll read PR on the forum I'll remember it, plus it looks like the official term around here:








						Bug Reports
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org
				




So I followed your advice and I reported the bug, now as people say wait & see:





						267122 – editors/micro: missing syntax highlighting
					






					bugs.freebsd.org
				




Thanks both of you T-Daemon & rorgoroth for your help


----------



## gotnull (Nov 24, 2022)

A fix has been made that I did not test yet .
Thanks Alexey 
He also improved the package by adding a man page, a desktop file, and icons.

Correct me if I am wrong , but I do need to be on "latest" to benefit from the fix, right ?
If so I will need to learn bhyve (which is on my todo list) sooner than I thought .


----------



## T-Daemon (Nov 24, 2022)

gotnull said:


> Correct me if I am wrong , but I do need to be on "latest" to benefit from the fix, right ?


Not necessarily. You could ask in the PR you have filed, that the update be also applied to ports branch 2022Q4 (quarterly branch). If applied, a package should be available shortly after in the quarterly package repository.


----------



## gotnull (Nov 24, 2022)

Okay that's a good news then, I will do that then, if it's a possible thing to do it worth asking for it.
I will update the post to let you know what happens.


----------



## gotnull (Nov 26, 2022)

Done, I asked for it, but I didn't change the PR's status from "fixed" to "open" (or even if I am able to do it), I wonder if it's the right way to proceed, I mean the bug is fixed now so does the PR deserve really to be reopened ?


----------



## T-Daemon (Nov 26, 2022)

gotnull said:


> Done, I asked for it, but I didn't change the PR's status from "fixed" to "open" (or even if I am able to do it), I wonder if it's the right way to proceed, I mean the bug is fixed now so does the PR deserve really to be reopened ?


The PR doesn't need to be reopened for your request. The author and committer of the commit (Alexey) will receive with your comment in the PR automatically a mail and can evaluate your query.


----------



## gotnull (Nov 26, 2022)

T-Daemon said:


> The PR doesn't need to be reopened for your request. The author and committer of the commit (Alexey) will receive with your comment in the PR automatically a mail and can evaluate your query.


Yep it looks like you right because he already answered. Thank you for the explanation.

I post his answer here:


> I don't do quarterlies (nor I should be even allowed to, given it's a ports-secteam@ territory) but I'll try to find someone who might help.



So I will keep my fingers crossed.


----------

