Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple instances #533

Closed
Innomen opened this issue Mar 4, 2015 · 53 comments
Closed

Multiple instances #533

Innomen opened this issue Mar 4, 2015 · 53 comments

Comments

@Innomen
Copy link

Innomen commented Mar 4, 2015

It's cumbersome to have a conversation with two or more people at once since I can't have multiple windows.

I assume this isn't possible, I've tried and tried, and I can't find any other matching requests either.

Sorry if I missed something.

@ChaosMarc
Copy link

if you use the portable version from https://desktop.telegram.org/ you can easily launch multiple instances.

@Innomen
Copy link
Author

Innomen commented Mar 5, 2015

Ahh! Good to know. I'll try that right away :)

Update: Trying to run a second instance just brings the first into focus. I can however make multiple folders and run multiple copies that way. Which while workable is pretty clunky. Still, thanks, it'll do for now :)

@phplego
Copy link

phplego commented Mar 14, 2015

👍

you can easily launch multiple instances.

It does not work on Ubuntu. Trying to run a second instance just brings the first into focus.

@Innomen
Copy link
Author

Innomen commented Mar 14, 2015

Every chat window should have a "pop out" button. I'm confident that it will as the desktop app begins to compete with pidgin and the like more :)

@cobalto
Copy link

cobalto commented Mar 17, 2015

Multiple accounts would be nice too, but sure multiple instances looks easier to implement and do the same enough

@auchri auchri changed the title [Feature Request]: Multiple instances. Multiple instances Sep 4, 2015
This was referenced Sep 4, 2015
@mautematico
Copy link

Are there any news about this multiple instances thing? :)

@Innomen
Copy link
Author

Innomen commented Jan 31, 2016

I guess it's low priority. /shrugs

@DiThi
Copy link

DiThi commented Feb 1, 2016

This has an easy workaround (using several copies of the portable version). There's no workaround for using several instances in mobile, though (other than using several android accounts, but you don't get notifications of the other accounts that way).

@mautematico
Copy link

When using, let say, Mozilla Firefox, you can pass -P and --no-remote parameters to get multiple instances running at the same time:

firefox -P 'profile one'
firefox -P 'profile two' --no-remote

May be tdesktop can use some parameter like those, and give the user choice to select profile/data dir

(using several copies of the portable version)
I think portable version is not available for GNU/Linux, is it?

Thank you all for the great work!

@humiaozuzu
Copy link

Any update?

@auchri
Copy link
Contributor

auchri commented May 17, 2016

You can start multiple instances with the following command:

  1. Telegram -many -workdir "C:\Users\asd\Desktop\instance1\data"
  2. Telegram -many -workdir "C:\Users\asd\Desktop\instance2\data"

I think it should be the same for linux.

@auchri auchri closed this as completed May 17, 2016
@ggeldenhuis
Copy link

Starting multiple instances is not a solution and closing the ticket is certainly not the way to make this go away.

@auchri
Copy link
Contributor

auchri commented May 18, 2016

This issue was about multiple instances and it's fixed.

@mbnoimi
Copy link

mbnoimi commented May 27, 2016

@auchri

Telegram -many -workdir "C:\Users\asd\Desktop\instance1\data"

I think it should be the same for linux..

It doesn't work under Linux as I expected. I created this launcher but unfortunately it fails:

telegram-sim2.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=Telegram Desktop SIM2
Icon=telegram
Exec=/home/halo/.Telegram/Telegram  -many -workdir /home/halo/.TelegramDesktopSIM2
Path=/home/halo/.TelegramDesktopSIM2
NoDisplay=false
Categories=Network;
StartupNotify=false
Terminal=false

@par6n
Copy link

par6n commented Jun 19, 2016

Worked perfectly in Ubuntu 15.04 (elementary 0.3.2 distro):

Telegram -many -workdir /home/ehsaan/.dubaisimcard/

@MJafarMashhadi
Copy link

@mbnoimi workdir directory should be created before launching telegram

@Innomen
Copy link
Author

Innomen commented Oct 6, 2016

It seems my patience will only be punished when petulant devs are at play.

Seriously, why even bother having an issues page if you're going to find excuses to ignore them all?

It seems this app will NEVER have spell checking, multiple windows, log export, or user specific backgrounds. Because reasons? Party like it's 1999.

Oh wait, even in '99 chat apps had multiple windows, logs, and spell checking.

Pathetic that in 2016 I find myself looking back at the likes of ICQ and Aim and seeing them as objectively more advanced.

We truly are a decadent culture. I wonder how long till we start tearing down our monuments because we've forgotten how to quarry fresh stone.

In any case I'll just encourage my few contacts to migrate to a better app with a maintainer or two that gives a damn for something other than snarking and receiving compliments.

I pity everyone else afflicted by vendor lock in. Now I know why I'm not permitted to export my chat log. To sustain the aforementioned vendor lock in.

Enjoy the snide last word devs or devknights. This thread is now being ignored by me as well.

(Right wing profit motive excuses in 3... 2... 1...)

@john-preston
Copy link
Member

@Innomen Wow, that was touching.. :'(

@cobalto
Copy link

cobalto commented Oct 7, 2016

@Innomen
how_rude

@stek29
Copy link
Contributor

stek29 commented Oct 7, 2016

@Innomen What's the license of your comment? Can I use it?

@stek29
Copy link
Contributor

stek29 commented Oct 24, 2017

@cryptoneep yup, it doesn't work on macOS sadly :(
Maybe you'll open an issue?

@anjunatl
Copy link

anjunatl commented Nov 1, 2017

I've been itching for this feature, and I'm on OS X. I'll look through the code and see if I can do it, and if I can I'll make a pull request.

@noark9
Copy link

noark9 commented Jan 13, 2018

Telegram -many -workdir pathtoworkdir

works perfect on fedora 27

@MrSwed
Copy link

MrSwed commented Jan 14, 2018

works on win7. but needs to create before workdir

so this could be realized by means of the telegram itself, inho

@cryptoneep
Copy link

Great, would love this on OSX as well!

@cobalto
Copy link

cobalto commented Jan 15, 2018

Well, It's a canon functionality on the mobile app now...

@linuxtopia
Copy link

how to apply for Telgram portable version of Linux that workdir? Command line doesnt know Telgram even cause of portable

@Rocco83
Copy link

Rocco83 commented Apr 3, 2018

+1 on that feature.
A plus would be the possibility to cleanup all of the content upon exit, keeping only the auth stuff.

@d0tfile
Copy link

d0tfile commented Apr 4, 2018

@Rocco83 you can use Telegram -many -workdir pathtoworkdir, where pathtoworkdir it mounted as tmpfs for example. Directory pathtoworkdir will be destroyed after reboot.

@Rocco83
Copy link

Rocco83 commented Apr 4, 2018

@d0tfile thanks for the workaround.
I am anyway looking forward to do it without nasty double application.
As already mentioned, the multiple account are already a feature.
This must be "in" the application.
Also, if pathtoworkdir is missing, then also the authentication will be gone, and has to be re-issued. Which make sense, but again then a "flag" in the application is something that i would expect.

@Draghmar
Copy link

Could someone explain me how to use this command with portable Telegram on Windows?
Telegram -many -workdir pathtoworkdir
I created two folders in Telegram folder and created two shortcust to the .exe file where I putted command for each temp folder. But when I try to launch second instance I'm getting some error:

[2018.04.21 15:37:39] Launched version: 1002017, alpha: [FALSE], beta: 0, debug mode: [FALSE], test dc: [FALSE]
[2018.04.21 15:37:39] Executable dir: D:/Użytki/Telegram/, name: Telegram.exe
[2018.04.21 15:37:39] Initial working dir: D:/Użytki/Telegram/
[2018.04.21 15:37:39] Working dir: D:/Użytki/Telegram/
[2018.04.21 15:37:39] Command line: D:\Użytki\Telegram\Telegram.exe -many -workdir D\Użytki\Telegram\temp2
[2018.04.21 15:37:39] Executable path before check: D:/Użytki/Telegram/Telegram.exe
[2018.04.21 15:37:39] Logs started
[2018.04.21 15:37:39] Many instance allowed, starting...
[2018.04.21 15:37:39] FATAL: Could not open 'D:/Użytki/Telegram/tdata/working' for writing!

What I'd like to achieve is to use Telegram with one account on two Windows profiles (I had two: personal and for work), which I often switch (not log out) between and Telegram can work only on one of them. I thought that is something normal for this app when you have web and mobile version working at the same time without any issues.

@stek29
Copy link
Contributor

stek29 commented Apr 21, 2018

@Draghmar There can't be two apps instances at the same time with one tdata folder.
Even if you somehow trick TDesktop to launch it would lose messages and show other weird things caused by how one auth key pair for multiple instances works (or rather doesn't work).

You can, however, just log in with two separate instances, or close TDesktop in one profile before opening it in other one.

@Draghmar
Copy link

Draghmar commented Apr 21, 2018

@stek29 Ok, so what's this command actually do? Because I thought it was for that purpose.
Closing is out of the question - too much hassle. And what do you mean by separate instances? Making two copies (folders) of the TDesktop and running each of them on one of the profiles?

@auchri
Copy link
Contributor

auchri commented Apr 21, 2018

@Draghmar I think you forgot the :
The path should be D:\foo instead of D\foo.

@Draghmar
Copy link

@auchri Oh man...How stupid of me. I didn't noticed that missing colon. Thanks!

@sadalhayat
Copy link

@cryptoneep

on mac, just use -workdir
don't add -many argument.

I'll try to create the script for launcher and share it here.

@sadalhayat
Copy link

sadalhayat commented Aug 8, 2018

header

How to run Telegram Desktop as portable app and multiple instances on macOS

http://telegra.ph/tdmac-08-07

On Linux,
you can use -many -workdir command line parameter or create the launcher.
#533 (comment)

On macOS,
just use -workdir parameter, it won’t work if you add -many.
<path to Telegram binary> -workdir <path to folder>

command in mac


How to create TDesktop launcher app with Apple Script Editor:

1. Open Script Editor on /Applications/Utilities.

2. Copy following script:

set rootFolder to POSIX path of ((path to me as text) & "::")
set dataFolder to (rootFolder & "cache")
set appPath to (rootFolder & "Telegram.app")
do shell script "mkdir -p \"" & dataFolder & "\""
do shell script "open -a \"" & appPath & "\" --args -workdir \"" & dataFolder & "\""

script

3. Save as Application, let’s called “launcher”. Close Script Editor.

save as app

4. Put the launcher in the same folder with Telegram.app of TDesktop stable/alpha.
Download from desktop.telegram.org or GitHub, don’t use TDesktop from Mac AppStore.

5. Done. Run the launcher.

You can clone and create alias/shortcut for your launcher, also you can use it as portable app for removable USB disk.

App data are stored in “cache” workdir, same folder with the laucher & app. If you want to use different name, edit the launcher with Script Editor.

launcher


Security Settings:

  • Enable cloud password (Two-step Verification).
  • Enable local passcode.
  • Check active sessions regularly.

cc @john-preston @stek29 @cryptoneep

@yegor256
Copy link

yegor256 commented Jul 1, 2019

@auchri doesn't work on macOS for me, unfortunately. I submitted an issue about it, would be great if you can take a look: #6198

@lgg
Copy link

lgg commented Oct 25, 2019

@mbnoimi @auchri I used method with -many and -workdir, but now I can't split them to separate instances of app. How I can do that? (like this 2 instances are different apps). On windows everything works fine btw
image
Ubuntu 19, gnome

@mbnoimi
Copy link

mbnoimi commented Oct 25, 2019

@lgg The following launcher works fine under Linux Mint 19.2 XFCE

Telegram-SIM2.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=Telegram SIM2
Icon=telegram
Exec=/home/halo/.Telegram/Telegram -startintray -many -workdir /home/halo/.TelegramDesktopSIM2
Path=/home/halo/.TelegramDesktopSIM2
NoDisplay=false
Categories=Network;
StartupNotify=false
Terminal=false

@lgg
Copy link

lgg commented Oct 25, 2019

@mbnoimi tray icons are different, but app windows are in one icon on gnome dock
image

@mbnoimi
Copy link

mbnoimi commented Oct 25, 2019

@mbnoimi tray icons are different, but app windows are in one icon on gnome dock

Unfortunately I never used Ubuntu desktop.

@adnanhaddad
Copy link

adnanhaddad commented Jan 28, 2021

When running Telegram -many -workdir "C:\Users\asd\Desktop\instance1\data"
I'm getting this window with an error:
image

Does anybody have the same error and have a fix for it?

@RememberTheAir
Copy link

RememberTheAir commented Jan 28, 2021

@adnanhaddad I don't think you need the -many flag anymore, I've been using just the -workdir option and it works perfectly

You should post the log btw

@adnanhaddad
Copy link

@RememberTheAir Thanks for replying. Without the -many flag the command would open the same instance it's already open. I would like to have multiple instances (one on each Desktop I have open). There were no logs to show. I took a screenshot and posted it as is.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests