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

Feature Request : Save opened tabs and locations of the tabs #455

Closed
devsmart opened this issue Apr 9, 2015 · 23 comments
Closed

Feature Request : Save opened tabs and locations of the tabs #455

devsmart opened this issue Apr 9, 2015 · 23 comments

Comments

@devsmart
Copy link

devsmart commented Apr 9, 2015

I'd like to have feature to save last opened tabs and reopen those with last saved paths.

@devsmart devsmart changed the title Feature Request : Save opened tabs and locations on the tab Feature Request : Save opened tabs and locations of the tabs Apr 9, 2015
@MartiUK
Copy link
Member

MartiUK commented Apr 9, 2015

Settings > Startup > Auto save/restore opened tabs

@devsmart
Copy link
Author

devsmart commented Apr 9, 2015

WOW!! thanks !

@devsmart devsmart closed this as completed Apr 9, 2015
@ClementParis016
Copy link

I was exactly looking for this solution but it doesn't work for me :(

If I check the "auto save/restore opened tabs" option, when I restart Cmder, all tabs are set to the root drive location (in my case "Z:/"), instead of the folder they were opened in. Also, each tab lost its name and is now called as default "cmd.exe".

Is this normal?

PS: I am using Windows 8.1 with latest Cmder version.

@petersandor
Copy link

I have the same problem as @ClementParis016 and I have version 1.1.4.101.

It always follows some tasks that are somehow defined once (never actualy saving the last configuration before exit), funny thing is that I can't see these tasks on Tasks page.

image

@download13
Copy link

Same problem here. I'm using Git Bash which might have something to do with it.

@aludvigsen
Copy link

Same problem here. All the tabs gets reopened, and they keep their names, but all the directories gets changed to the default directory C:\Users\<username>\Documents.

Any suggestions?

@azeroth2b
Copy link

azeroth2b commented May 19, 2016

My problem is worse than these reports from August and February... the windows and per-windows settings are never saved off. Is this feature broken or incomplete?

@jump
Copy link

jump commented Aug 16, 2016

i'm also highly interested in getting this feature to work properly.

@wis
Copy link

wis commented Aug 20, 2016

i'm also highly interested in getting this feature to work properly.


👍 4

@hieudang9
Copy link

Same here, please update this feature.

@TommyLike
Copy link

Settings > Startup > Auto save/restore opened tabs @hieudang9

@Skintillion
Copy link

Profile Tabs saver would be awesome. "Save tab group as". Would be great if dealing with multiple projects.

@fleed
Copy link

fleed commented Jun 24, 2017

Settings > Startup > Auto save/restore opened tabs is helpful, but I totally agree with @Skintillion: it would still be good to have the possibility to save different sets/groups of tabs to switch between contexts/projects

@Fallibilist
Copy link

Fallibilist commented Jan 31, 2018

If anyone previously set the default directory of Cmder by modifying the init file you'll need to remove the line you added for this feature to work correctly. That line executes after startup for each tab and changes all directories to your default directory as opposed to your previous tabs.

@oshihirii
Copy link

Is there a way to "save a workspace"?

I currently have 6 tabs saved, which is great (they all open on restart), but what happens if i start cmder, reduce tabs to 1, then close.

Will the 6 tab workspace no longer exist?

@bUxEE
Copy link

bUxEE commented Jul 6, 2018

Saving workspaces with predefined tabs would be a really great feature

@otonielguajardo
Copy link

any news on this?

@daxgames
Copy link
Member

This issue is closed, there is no news to be had. There is already a feature to save open tabs. If this is not what you want I suggest you ask the conemu developer for a feature enhancmwnt. We do not maintain conemu.

@Cobertos
Copy link

Cobertos commented Oct 19, 2018

If you're using Git bash or WSL bash, this small snippet should work for both. It will trigger updates to ConEmu when those respective shells change directories. Not sure if/why this isn't in cmder by default. Add it to your .bashrc or equivalent file.

#ConEmu Integration
if [[ -n "${ConEmuPID}" ]]; then
  #For WSL and cygwin/msys connector (which ConEmu will use for Git bash). It
  #sends an operating system command (OSC) to cygwin/msys connector to update the
  #cwd on PS1 print (the \$PWD in the below string, \w will not work).
  #https://conemu.github.io/en/ShellWorkDir.html#connector-ps1
  #https://github.com/Maximus5/ConEmu/issues/1752
  PS1="\[\e]9;9;\"\$PWD\"\007\e]9;12\007\]$PS1"
fi

EDIT: I had to update it, there's actually a bug in ConEmu that prevents this from working specifically in directories with ~ in Git Bash...

If you're at all curious how it works or a more in depth integration of this, you might want to check out a blog post I wrote after spending hours debugging this stuff

@digeomel
Copy link

digeomel commented Mar 7, 2019

This has solved the problem for me. Thank you @Cobertos ! 😄

@tdebaets
Copy link

If you're using Git bash or WSL bash, this small snippet should work for both. It will trigger updates to ConEmu when those respective shells change directories. Not sure if/why this isn't in cmder by default. Add it to your .bashrc or equivalent file.

#ConEmu Integration
if [[ -n "${ConEmuPID}" ]]; then
  #For WSL and cygwin/msys connector (which ConEmu will use for Git bash). It
  #sends an operating system command (OSC) to cygwin/msys connector to update the
  #cwd on PS1 print (the \$PWD in the below string, \w will not work).
  #https://conemu.github.io/en/ShellWorkDir.html#connector-ps1
  #https://github.com/Maximus5/ConEmu/issues/1752
  PS1="\[\e]9;9;\"\$PWD\"\007\e]9;12\007\]$PS1"
fi

Even with this snippet from @Cobertos added to my .bashrc, restoring any tabs containing a Cygwin shell still failed on my system. When starting up ConEmu, this was displayed for each such tab:

Can't create new console, command execution failed

Error code: 267

<snip>

Try again with new console dialog?

Error code 267 is ERROR_DIRECTORY ("The directory name is invalid"), which pointed me to the fact that ConEmu actually saved the current directory of Cygwin shells to the ConEmu.xml file as a Unix-style path (e.g. \home\tdebaets). While the forward slashes in the path were already converted to backslashes, this obviously wasn't enough for ConEmu to find the path and was causing the errors on ConEmu startup.

I was able to fix this by adding an extra cygpath -w command to the PS1 environment variable, to convert the Unix-style paths to Windows paths:

PS1="\[\e]9;9;\"\$(cygpath -w \"\$PWD\")\"\007\e]9;12\007\]$PS1"

@daxgames
Copy link
Member

Not sure I understand what this actually does and what problem it solves?

@tdebaets
Copy link

tdebaets commented Mar 1, 2023

@daxgames Modifying the PS1 environment variable is needed to notify ConEmu of the shell's current directory, see https://conemu.github.io/en/ShellWorkDir.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests