jumaris / connectbot

Automatically exported from code.google.com/p/connectbot
Apache License 2.0
1 stars 0 forks source link

Allow keeping multiple connections open to a host #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice if I could have multiple connections open to the same
host. There doesn't currently seem to be any way to do this; making two
copies of a host just seems to confuse connectbot.

Original issue reported on code.google.com by gwillen@gmail.com on 24 Mar 2009 at 4:58

GoogleCodeExporter commented 8 years ago
i think using 'screen' is a better option than having multiple connections open 
and
it makes more sense.

Original comment by unpaid.b...@gmail.com on 3 Apr 2009 at 7:01

GoogleCodeExporter commented 8 years ago
That may be fine for you, but there are a lot of different circumstances people 
have
to deal with (sshing into an embedded device with no 'screen' binary?), and an 
ssh
that can't deal with multiple sessions to the same machine is effectively 
crippled.
(Which is not intended as a criticism of ConnectBot -- I know developer-hours 
are
scarce, and if I had time I'd write the support myself. I'm just saying it's not
something to leave out as a design decision.)

Original comment by gwillen@gmail.com on 3 Apr 2009 at 4:17

GoogleCodeExporter commented 8 years ago
I discovered bug 51, which points out that you can accomplish this by changing
nickname. Ideally I'd much prefer if distinct host entries behaved as distinct 
even
if they have the same nickname; right now you can get weird behavior (including
crashes) by doing things to the second of two entries with the same nickname 
(such as
adding port forwards.) If left to my own devices I will try to figure out how to
implement that behavior, and supply a patch. :-)

Original comment by gwillen@gmail.com on 6 Apr 2009 at 3:55

GoogleCodeExporter commented 8 years ago
Hm - this unfortunately seems to require architectural changes (the 
TerminalBridge is
pretty well set on the nickname being a unique identifier for the host. I 
changed the
ssh:// URIs to include a unique ID, but then I had to strip it back out at some 
point
when parsing the URI, because otherwise I get a new host added with the id in 
the
nickname.)

I may attempt a simpler fix; to default the nickname of a new instance of an 
existing
host to have a "(2)", "(3)", etc. on the end of it.

Original comment by gwillen@gmail.com on 6 Apr 2009 at 7:08

GoogleCodeExporter commented 8 years ago
To continue spamming the bug (sorry :-), I realize I was mistaken, and no large
changes are required after all. Here is a rudimentary patch to add this
functionality. (It needs cleanup yet -- it still contains XXX comments, and I
accidentally mangled the indentation on the lines I touched.)

Changes: 

I changed HostBeans so that they compare by unique ID from the database and not 
just
by nickname; I changed the format of the ssh:// URIs so that the fragment 
(after #)
contains the unique ID in addition to the nickname; and I added code to emit and
parse the new ssh:// format in what seem to be the necessary places so that 
sessions
with different IDs are treated as distinct.

It works for me; please test and let me know whether it works for you! I think 
I've
also eliminated the crash bugs related to duplicate hosts -- please let me know 
if
you encounter any such crashes.

Original comment by gwillen@gmail.com on 6 Apr 2009 at 8:25

Attachments:

GoogleCodeExporter commented 8 years ago
The problem with using the ID from the database is that you can connect to hosts
without them being in the database at all.

I'll take a look at this, though.

Original comment by kenny@the-b.org on 5 May 2009 at 10:15

GoogleCodeExporter commented 8 years ago
It's been awhile since I worked on this, but my best recollection is that when 
you
quick-connect to a host, it gets added to the database immediately, before the
connection is made, so I just used the ID returned by the database insertion.

Original comment by gwillen@gmail.com on 5 May 2009 at 11:03

GoogleCodeExporter commented 8 years ago
Definitely typing in the quick-connect box will save it to the database. 
However, if
you ask for a handler for ssh://user@host/ URLs from another program, then it 
won't
be saved to the database.

You can see this in action if you long-press on your desktop, create a shortcut 
to a
ConnectBot host, and then delete the host from your host list. You can still 
connect
to it via the shortcut, but it won't be saved in the database.

Original comment by kenny@the-b.org on 6 May 2009 at 3:02

GoogleCodeExporter commented 8 years ago
This works as long as the nicknames are different for the hosts.

Original comment by kenny@the-b.org on 14 Aug 2009 at 12:24

GoogleCodeExporter commented 8 years ago
Issue 216 has been merged into this issue.

Original comment by kenny@the-b.org on 7 Nov 2009 at 2:02