Bug 462295 - [TERMINALS] backspace key does not work in telnet terminal connected to gogo shell
Summary: [TERMINALS] backspace key does not work in telnet terminal connected to gogo ...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: terminal (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-16 21:36 EDT by Greg Amerson CLA
Modified: 2020-09-04 15:11 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Amerson CLA 2015-03-16 21:36:16 EDT
Steps to reproduce:

1. launch any osgi runtime that embeds the gogo shell that listens for incoming tcp connections (telnet)
2. create a new telnet terminal and open a connection to gogo
3. notice that typing commands and executing them works
4. but if you try to type a command and then press backspace, the backspace key doesn't work

My system is ubuntu linux 14.04 and my target osgi runtime is running this version of apache gogo shell

org.apache.felix.gogo.shell_0.10.0.jar
Comment 1 Greg Amerson CLA 2015-03-16 21:42:46 EDT
just extra info, the arrow keys and delete key works, but just not backspace.
Comment 2 Anton Leherbauer CLA 2015-03-17 04:35:34 EDT
The gogo shell seems to expect the DEL character (127). But we are still sending the backspace character (8). See also bug 205765.
Comment 3 Greg Amerson CLA 2015-03-17 04:46:13 EDT
Is the behavior in gogo shell incorrect?
Comment 4 Anton Leherbauer CLA 2015-03-17 05:03:55 EDT
(In reply to Greg Amerson from comment #3)
> Is the behavior in gogo shell incorrect?

No, but most telnet servers accept both DEL and BS. It might make sense to file an enhancement request with the gogo shell to handle BS in the same way as DEL.
Comment 5 Greg Amerson CLA 2015-03-17 05:20:43 EDT
(In reply to Anton Leherbauer from comment #4)
> (In reply to Greg Amerson from comment #3)
> > Is the behavior in gogo shell incorrect?
> 
> No, but most telnet servers accept both DEL and BS. It might make sense to
> file an enhancement request with the gogo shell to handle BS in the same way
> as DEL.

However, both DEL and BS work as expected when I telnet directly to gogo shell, but just not from within terminal view.  So does that mean that when I telnet from local xterm, it is sending a different charcode for BS to gogo?
Comment 6 Anton Leherbauer CLA 2015-03-17 05:45:24 EDT
(In reply to Greg Amerson from comment #5)
> However, both DEL and BS work as expected when I telnet directly to gogo
> shell, but just not from within terminal view.  So does that mean that when
> I telnet from local xterm, it is sending a different charcode for BS to gogo?

Yes.
Usually on Linux the backspace key creates a DEL character. Strictly speaking this depends on the terminal emulator and configuration (eg. you can also make xterm send a backspace character). The terminal view sends a BS character instead. This works in many cases where the BS and DEL character are handled equally.
Unfortunately we cannot just switch to sending a DEL character as we might cause a regression with telnet servers which only support the BS character.
Comment 7 Greg Amerson CLA 2015-03-17 06:11:41 EDT
That makes sense.

So here is my use case.  From my team's Eclipse plugin (Liferay IDE) we would like to automatically create a telnet terminal connection for the user when they invoke some action like "Connect to Liferay's OSGi console".

Then on behalf of the user action, our plugin could use the TCF terminal API to create an instance of a "telnet connection" where we provide some type of "setting" that would say this...."because I know my use-case and connection requirements, can you send always send a DEL instead of a BS just for this once instance of a telnet connection?" 

Doable?
Comment 8 Anton Leherbauer CLA 2015-03-17 06:18:18 EDT
(In reply to Greg Amerson from comment #7)
> That makes sense.
> 
> So here is my use case.  From my team's Eclipse plugin (Liferay IDE) we
> would like to automatically create a telnet terminal connection for the user
> when they invoke some action like "Connect to Liferay's OSGi console".
> 
> Then on behalf of the user action, our plugin could use the TCF terminal API
> to create an instance of a "telnet connection" where we provide some type of
> "setting" that would say this...."because I know my use-case and connection
> requirements, can you send always send a DEL instead of a BS just for this
> once instance of a telnet connection?" 
> 
> Doable?

Sure, my preference is to send DEL by default (as this is the most common case) and allow to override this per connection instance.
But currently the character to send for the backspace key is entirely hard-coded.
Comment 9 Greg Amerson CLA 2015-03-17 20:41:39 EDT
I'd like to help contribute if you don't have time to implement this API.  Can you point me to which class I should look at first?
Comment 10 Anton Leherbauer CLA 2015-03-18 03:59:06 EDT
(In reply to Greg Amerson from comment #9)
> I'd like to help contribute if you don't have time to implement this API. 
> Can you point me to which class I should look at first?

The option whether to send DEL or BS needs to be added to org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl perhaps similar to setVT100LineWrapping.

This at least allows for setting the option at creation and connect time, but clients of the TCF Terminals API usually don't have control over creation and connection, therefore it is also necessary to add a property to the org.eclipse.tcf.te.core.terminals.interfaces.constants.ITerminalsConnectorConstants on the TCF side and consider this option at creation time.

Note that the TCF Terminals code is going to be moved to the Target Management project in the near future, so I'd wait with any coding until the move is complete.
Comment 11 Martin Oberhuber CLA 2015-05-14 11:35:37 EDT
Hi Greg,

The restructuring of the Terminal has been completed, and we'd really appreciate your contribution ! See the CONTRIBUTING guide here:

   http://git.eclipse.org/c/tm/org.eclipse.tm.terminal.git/tree/CONTRIBUTING

Please let us know if you have any questions - we'll be glad to try and help !

Thanks,
Martin
Comment 12 Jonah Graham CLA 2020-05-01 10:09:29 EDT
The Terminal component of the Eclipse Ecosystem has a new home. The Terminal is now part of the Eclipse CDT project[1].

This change means a new Git repo[2], P2 site[3] and Bugzilla component. The terminal will continue to be delivered as part of the quarterly Simultaneous Release of Eclipse as well.

The marketplace entry[4] had not been updated in a few years. It will once again install the latest release of the terminal on the latest release of the whole IDE (currently 2020-03).

If this bug is no longer relevant, please feel free to comment or close the bug. If you can confirm if this issues still occurs in the latest release please do let me know in a comment.

[1] https://wiki.eclipse.org/CDT/User/NewIn911
[2] https://git.eclipse.org/c/cdt/org.eclipse.cdt.git (in the terminal directory)
[3] current release is 9.11 - P2 site https://download.eclipse.org/tools/cdt/releases/9.11/
[4] https://marketplace.eclipse.org/content/tm-terminal

(This comment was added to all open terminal bugs along with changing the Product/component pair to CDT/terminal.)