How to exit nano from a different terminal?

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I was ssh'ing into a Raspberry Pi running Raspbian, editing a file with nano, when I lost my internet connection (by leaving the WiFi zone). After reconnecting an hour later, I found that the pi had kicked me out, but after logging back in, I saw that it did not stop the task. When I reopened nano, it told me that the file was being edited by the previous nano process, and it gave me the PID. I made substantial changes to the file and forgot to save, but presumably the changes are still there.
How can I tell nano to save & quit (^O -> Enter -> ^X) or reopen the task in a new shell, from outside the original process?
bash process raspbian nano
 |Â
show 4 more comments
up vote
2
down vote
favorite
I was ssh'ing into a Raspberry Pi running Raspbian, editing a file with nano, when I lost my internet connection (by leaving the WiFi zone). After reconnecting an hour later, I found that the pi had kicked me out, but after logging back in, I saw that it did not stop the task. When I reopened nano, it told me that the file was being edited by the previous nano process, and it gave me the PID. I made substantial changes to the file and forgot to save, but presumably the changes are still there.
How can I tell nano to save & quit (^O -> Enter -> ^X) or reopen the task in a new shell, from outside the original process?
bash process raspbian nano
3
It's unlikely you'll be able to reattach to that session, or send it anything meaningful. If nano 'knows' that the file is open, there's a good chance that the temporary save has been written somewhere and this serverfault answer may be how you are required to resolve this: serverfault.com/questions/453703/â¦
â cunninghamp3
May 3 at 21:12
1
One of nanoâÂÂs online man pages indicates it will write buffers out to files named nano.save if it receives a HUP or TERM signal. Test on an innocent file first!
â Jeff Schaller
May 3 at 21:16
maybe this link will help you : unix.stackexchange.com/questions/31824/â¦
â D'Arcy Nader
May 3 at 21:16
I see a <myfile.py.save> file in my directory, thanks @JeffSchaller, would you like to write an answer?
â OldBunny2800
May 3 at 21:17
I would, but cannot right now. Please feel free to do so yourself.
â Jeff Schaller
May 3 at 21:33
 |Â
show 4 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I was ssh'ing into a Raspberry Pi running Raspbian, editing a file with nano, when I lost my internet connection (by leaving the WiFi zone). After reconnecting an hour later, I found that the pi had kicked me out, but after logging back in, I saw that it did not stop the task. When I reopened nano, it told me that the file was being edited by the previous nano process, and it gave me the PID. I made substantial changes to the file and forgot to save, but presumably the changes are still there.
How can I tell nano to save & quit (^O -> Enter -> ^X) or reopen the task in a new shell, from outside the original process?
bash process raspbian nano
I was ssh'ing into a Raspberry Pi running Raspbian, editing a file with nano, when I lost my internet connection (by leaving the WiFi zone). After reconnecting an hour later, I found that the pi had kicked me out, but after logging back in, I saw that it did not stop the task. When I reopened nano, it told me that the file was being edited by the previous nano process, and it gave me the PID. I made substantial changes to the file and forgot to save, but presumably the changes are still there.
How can I tell nano to save & quit (^O -> Enter -> ^X) or reopen the task in a new shell, from outside the original process?
bash process raspbian nano
asked May 3 at 20:58
OldBunny2800
1415
1415
3
It's unlikely you'll be able to reattach to that session, or send it anything meaningful. If nano 'knows' that the file is open, there's a good chance that the temporary save has been written somewhere and this serverfault answer may be how you are required to resolve this: serverfault.com/questions/453703/â¦
â cunninghamp3
May 3 at 21:12
1
One of nanoâÂÂs online man pages indicates it will write buffers out to files named nano.save if it receives a HUP or TERM signal. Test on an innocent file first!
â Jeff Schaller
May 3 at 21:16
maybe this link will help you : unix.stackexchange.com/questions/31824/â¦
â D'Arcy Nader
May 3 at 21:16
I see a <myfile.py.save> file in my directory, thanks @JeffSchaller, would you like to write an answer?
â OldBunny2800
May 3 at 21:17
I would, but cannot right now. Please feel free to do so yourself.
â Jeff Schaller
May 3 at 21:33
 |Â
show 4 more comments
3
It's unlikely you'll be able to reattach to that session, or send it anything meaningful. If nano 'knows' that the file is open, there's a good chance that the temporary save has been written somewhere and this serverfault answer may be how you are required to resolve this: serverfault.com/questions/453703/â¦
â cunninghamp3
May 3 at 21:12
1
One of nanoâÂÂs online man pages indicates it will write buffers out to files named nano.save if it receives a HUP or TERM signal. Test on an innocent file first!
â Jeff Schaller
May 3 at 21:16
maybe this link will help you : unix.stackexchange.com/questions/31824/â¦
â D'Arcy Nader
May 3 at 21:16
I see a <myfile.py.save> file in my directory, thanks @JeffSchaller, would you like to write an answer?
â OldBunny2800
May 3 at 21:17
I would, but cannot right now. Please feel free to do so yourself.
â Jeff Schaller
May 3 at 21:33
3
3
It's unlikely you'll be able to reattach to that session, or send it anything meaningful. If nano 'knows' that the file is open, there's a good chance that the temporary save has been written somewhere and this serverfault answer may be how you are required to resolve this: serverfault.com/questions/453703/â¦
â cunninghamp3
May 3 at 21:12
It's unlikely you'll be able to reattach to that session, or send it anything meaningful. If nano 'knows' that the file is open, there's a good chance that the temporary save has been written somewhere and this serverfault answer may be how you are required to resolve this: serverfault.com/questions/453703/â¦
â cunninghamp3
May 3 at 21:12
1
1
One of nanoâÂÂs online man pages indicates it will write buffers out to files named nano.save if it receives a HUP or TERM signal. Test on an innocent file first!
â Jeff Schaller
May 3 at 21:16
One of nanoâÂÂs online man pages indicates it will write buffers out to files named nano.save if it receives a HUP or TERM signal. Test on an innocent file first!
â Jeff Schaller
May 3 at 21:16
maybe this link will help you : unix.stackexchange.com/questions/31824/â¦
â D'Arcy Nader
May 3 at 21:16
maybe this link will help you : unix.stackexchange.com/questions/31824/â¦
â D'Arcy Nader
May 3 at 21:16
I see a <myfile.py.save> file in my directory, thanks @JeffSchaller, would you like to write an answer?
â OldBunny2800
May 3 at 21:17
I see a <myfile.py.save> file in my directory, thanks @JeffSchaller, would you like to write an answer?
â OldBunny2800
May 3 at 21:17
I would, but cannot right now. Please feel free to do so yourself.
â Jeff Schaller
May 3 at 21:33
I would, but cannot right now. Please feel free to do so yourself.
â Jeff Schaller
May 3 at 21:33
 |Â
show 4 more comments
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
In the comments, @JeffSchaller noted that a terminated nano process saves the unwritten file in file_path.extension.save.
If it is there, which it was for me, it is a simple matter of mving the file into its original name.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
In the comments, @JeffSchaller noted that a terminated nano process saves the unwritten file in file_path.extension.save.
If it is there, which it was for me, it is a simple matter of mving the file into its original name.
add a comment |Â
up vote
3
down vote
accepted
In the comments, @JeffSchaller noted that a terminated nano process saves the unwritten file in file_path.extension.save.
If it is there, which it was for me, it is a simple matter of mving the file into its original name.
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
In the comments, @JeffSchaller noted that a terminated nano process saves the unwritten file in file_path.extension.save.
If it is there, which it was for me, it is a simple matter of mving the file into its original name.
In the comments, @JeffSchaller noted that a terminated nano process saves the unwritten file in file_path.extension.save.
If it is there, which it was for me, it is a simple matter of mving the file into its original name.
answered May 3 at 21:39
OldBunny2800
1415
1415
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441660%2fhow-to-exit-nano-from-a-different-terminal%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
It's unlikely you'll be able to reattach to that session, or send it anything meaningful. If nano 'knows' that the file is open, there's a good chance that the temporary save has been written somewhere and this serverfault answer may be how you are required to resolve this: serverfault.com/questions/453703/â¦
â cunninghamp3
May 3 at 21:12
1
One of nanoâÂÂs online man pages indicates it will write buffers out to files named nano.save if it receives a HUP or TERM signal. Test on an innocent file first!
â Jeff Schaller
May 3 at 21:16
maybe this link will help you : unix.stackexchange.com/questions/31824/â¦
â D'Arcy Nader
May 3 at 21:16
I see a <myfile.py.save> file in my directory, thanks @JeffSchaller, would you like to write an answer?
â OldBunny2800
May 3 at 21:17
I would, but cannot right now. Please feel free to do so yourself.
â Jeff Schaller
May 3 at 21:33