DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

TIP: How to transfer terminal session between IDE and terminal Emulator?

Most IDE's embed a terminal session in my case it was the pycharm community (but can apply in most IDEs). On that I was developing a process take long time and I wanted to switch between projects.

But if I did that I was not sure whether the terminal session would end or not. Sometimesd I may even needed to close the IDE as well.

So in my case upon my IDE terminal I've run:

screen
Enter fullscreen mode Exit fullscreen mode

Because, I was developing a python project I needed to re-initialize the virtual environment (ommit if not developing in python):

source ^path_to_venv^
Enter fullscreen mode Exit fullscreen mode

(^path_to_venv^ is the path in which I have initialized the virtual environment if developing upon python replace with your own)

Then I run my script in my case was a python one.
Once my script was running I pressed CTRL+A+D in order to detatch the screen session.

Afterwards, I switched to another project, closing the IDE now was not an issue because the task was running into a detatched session.

If I wanted to see the execution progress of my script now I needed to open any terminal session and run:

screen -r
Enter fullscreen mode Exit fullscreen mode

And then I could re-detatch it by pressing CTRL+A+D again. I could see the progress again by typing screen -r.

I hope it is usefull. I am using linux for my development, Idk if approach above is applicable upon mac as well, I assume it is.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay