# Terminal is jumbling up code [not relevant]

EDIT: It seems (as pointed out by @peterleinchen) that the problem is with nano. I used vi instead to edit and could not reproduce the problem laid out below - closing question as not relevant ~ Edz

I have a strange problem with Terminal. Random digits are being removed or inserted causing my code to not work.

Jolla1 device is connected to PC via USB.

Nano is my default editor. Fingerterm is the default terminal.

The following code has worked without fail up until now;

        onClicked: {
if   (dimmer.color == "#90000000") dimmer.color = "#80000000"
else (dimmer.color == "#80000000") dimmer.color = "#70000000"
else (dimmer.color == "#70000000") dimmer.color = "#60000000"
else (dimmer.color == "#60000000") dimmer.color = "#50000000"
else (dimmer.color == "#50000000") dimmer.color = "#40000000"
else (dimmer.color == "#40000000") dimmer.color = "#30000000"
else (dimmer.color == "#30000000") dimmer.color = "#20000000"
else (dimmer.color == "#20000000") dimmer.color = "#10000000"
}


When I view my code again, I see this;

        onClicked: {
if   (dimmer.color == "#9000000m") dimmor.color0= "#800 0000"
else (dimmer.color == "#8000000m") dimmor.color0= "#700 0000"
else (dimmer.color == "#7000000m") dimmor.color0= "#600 0000"
else (dimmer.color == "#6000000m") dimmor.color0= "#500 0000"
else (dimmer.color == "#5000000m") dimmor.color0= "#400 0000"
else (dimmer.color == "#4000000m") dimmor.color0= "#300 0000"
else (dimmer.color == "#3000000m") dimmor.color0= "#200 0000"
else (dimmer.color == "#2000000m") dimmor.color0= "#100 0000"
}
}


But to see the code as it is above, I have to run the cursor forwards through it. All attempts to correct the text just makes things worse, resulting in errors for lipstick.

Where are these random numbers and letters coming from?, this was a minor problem with SFOS 3.1 but seems worse with SFOS 3.2

Related or duplicate?, hmmmm;

https://together.jolla.com/question/198062/terminal-in-developer-mode-is-horrible/

edit retag reopen delete

### The question has been closed for the following reason "question is not relevant or outdated"by Spam Hunter close date 2019-11-08 19:19:47.082046

2

What are you using to view the code? Does it happen with just 'cat xyz.qml'? I'm assuming you're sshing to the PC not the other way around and the issues are with Terminal app on phone (and possibly with the app that is used to view the code). Does it happen the same with vim/nano/joe/ed?

( 2019-11-08 14:47:06 +0300 )edit

You could try with toeterm (https://openrepos.net/content/rozz/toeterm) (and thumbterm maybe, not sure if that has been updated in a while though), as it had some fixes vs fingerterm, I do know nano has issues with line wrapping which can mess code (in your example though saving should probably not mess the file and only display is not updated properly). If this is a new 3.2 issue though probably worth raising here https://git.merproject.org/mer-core/fingerterm (I could not reproduce with the example code given in 3.1, tried with nano/ed/vim/joe and all edited/saved/loaded this part fine, so very likely 3.2, or the mess up happens with some previous code? probably also worth including the lipstick errors)

( 2019-11-08 15:19:21 +0300 )edit
2

Known (to me) problem with nano.

But I did not dare to ask for it as I did/do not expect any help to it. So forced to use vi more and more :)

Using fingerterm and nano on device sometimes throws in some newlines, which I know and can easily solve.

BUT when using the arrows and moving the cursor around text is completely overwritten with garbage or somethin put in between or something gets deleted.

Happens since long time ago...

( 2019-11-08 16:49:23 +0300 )edit
1

@peterleinchen - I managed to compile the latest version of nano (v4.5) and while it seems more responsive, the exact same problem occurs when used on my device. While vi does not present any problems, I am loathe to learn using vi, I have tried, I still have a cheat sheet, but I have spent many hours using nano without any real hindrance, it's easy and intuitive at least for me.

I note that nano is offered from jolla's repo, it has their name in the file extension, so I think I will open a new post regarding the few bugs of nano. I also note that this problem seems to only occur with 8 digit hex colours ("#12345678").

( 2019-11-08 21:09:17 +0300 )edit