Sublime Forum

Escape character error

#1

Hi,all.
Simple issue. I was trying to complie the following lines in sublime text 3. The ’ \n ’ and ’ \t ’ worked well ,while ’ \r ’ and ’ \b ’ didn’t display what it’s supposed to be whether in macOS or Windows.
I have searched it on the Internet, including the sublime forum. However, I can’t find anything helpful to interpret this.
Any guidance would be appreciated. Thanks in advance!

  print ('hello\rworld')
  print ('hello\nworld')
  print ('hello\tworld')
  print ('hello\bworld')

0 Likes

#2

\r and \b controls the caret position in a console. They are not meant to display something.

1 Like

#4

Thanks for your attention and the links. I see the use of the Carriage return and backspace in the console.

Here‘s the issue.I’ve installed two IDEs: sublime text 3 and mind+. The three lines were supposed to be the same in the terminal. However, they are not.I’ve looked for the same situation someone may have encountered in the technical support and other sections, but still can’t find it.

Have you got any advice for this so that I can pin down the problem?
Thanks in advance.

0 Likes

#5

Sublime Text doesn’t have a terminal; it has a build output panel. As such it doesn’t support input or control codes. The Terminus package embeds a terminal if that’s what you want, though a proper dedicated terminal emulator will always be more featureful.

0 Likes

#6

Thanks a lot. I’ll try the package.

0 Likes