We have moved to a new Sailfish OS Forum. Please start new discussions there.

# How to insert terminal output into a question? [answered]

asked 2017-04-15 16:31:55 +0300

Hi,

I would like to insert terminal output in a separate textboxt into a question here at TJC, but I don't know how to do this.

Using the "preformatted text" button effects only to the first text line and the "quote" button breaks the line break.

Thanks.

edit retag reopen delete

## 2 Answers

Sort by » oldest newest most voted

answered 2017-04-15 17:36:19 +0300

Inserting code here on TJC; yep, it doesn't always work and needs a little manual adjustment, plus if you are using a PC, you can see a preview below where you're typing.

So, drop a line, then click on the '101010' icon above to insert some code; The 'enter code here' message shows, highlighted in blue. place your cursor over the blue highlight, right click and paste your code;

     WeatherLoader {
id: weatherWidget
width: lockScreen.width
active: true; enabled: true
anchors {
bottom: parent.bottom
bottomMargin: Theme.paddingLarge
horizontalCenter: parent.horizontalCenter
}
}


Drop another line here to 'move away' from your pasted code and it should look like the above. If it still isn't working, try moving each line in by one or two spaces, keep an eye on the preview below your text box, then you can see if formatting is working.

Have a look at this image, this is a screengrab of me actually creating this post, note the positioning and indent/alignment of the code, this can have the wrong effect on your text;

more

## Comments

Thanks for your answer, but unfortunately it deosn't work. It affects only to the first line, the rest is normal text without line breaks.

Strange: When I copy your code and try again, it works. What am I doing wrong?

( 2017-04-15 18:14:12 +0300 )edit

Without actually watching you try it, I'm not sure what to say. Perhaps to check the formatting of the code you are pasting. It took me a while to work it out as well, it isn't totally intuitive, but keep playing about, you'll get it, I did, eventually.. I've added a screengrab to my original answer, check it out, it may help.

( 2017-04-15 19:45:37 +0300 )edit

I don't get any further. I will have a look at it later. For now I have a solution. I putted the terminal output into a text file and posted this. Thanks for your efforts. Have a nice weekend.

( 2017-04-15 22:01:32 +0300 )edit

Your solution was probably the best one, as there is a fair bit of code. Otherwise, keep trying, especially if you only wish to display a snippet of code, like above. Regards,

( 2017-04-16 02:11:11 +0300 )edit

You can use html tag "pre"

( 2017-04-16 04:21:28 +0300 )edit

answered 2017-04-16 15:19:23 +0300

Thanks to @fmotl and @BirdZhang this problem is solved

Solution one is as @fmotl discribed in his answer in this thread. In addition to that I had to edit my codeblock at first by adding four spaces on each line on the left, beginning with the second line.

Solution two as @BirdZhang said in his comment to @fmotl's answer. I had to insert HTML tag pre at the begin and /pre at the end of the text (it is admittedly easier...). Don't forget the less-than and the greater-than-sign .

Thanks.

more

## Stats

Asked: 2017-04-15 16:31:55 +0300

Seen: 451 times

Last updated: Apr 17 '17