Repository: archlinux/archinstall

Issue:
After install, prompt the user if they want to chroot into the installation
I think it would be a good idea to add a prompt to ask the user if they want to chroot into the newly created installation after the installation steps are executed.

For instance in pseudo-code, 

```
choice = input("Would you like to chroot into the newly created installation? [Y/n]")
if choice.lower() == 'y':
     execute('arch-chroot /mnt');
```


Discussion:
I think this is a nice touch, it explains what's about to happen and it gives an easy way to jump into the new installation.
Also add the "finished" output after it:
```python
choice = input("Would you like to chroot into the newly created installation and perform post installation configurations? [Y/n]")
if choice.lower() in ("y", ""):
    installation.log("For post installations tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
    try:
        subprocess.check_call("arch-chroot /mnt", shell=True)
    except:
        pass
finally:
    installation.log("Installation completed without any errors. You may now reboot."
```
> I think this is a nice touch, it explains what's about to happen and it gives an easy way to jump into the new installation.
> Also add the "finished" output after it:
> 
> ```python
> choice = input("Would you like to chroot into the newly created installation and perform post installation configurations? [Y/n]")
> if choice.lower() in ("y", ""):
>     installation.log("For post installations tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
>     try:
>         subprocess.check_call("arch-chroot /mnt", shell=True)
>     except:
>         pass
> finally:
>     installation.log("Installation completed without any errors. You may now reboot."
> ```

I like this a lot. I think it'd be great to add this in.
By the way, is there a shortened link to that? from the installer, it's not like you can copy/paste https://wiki.archlinux.org/index.php/Installation_guide#Post-installation. 
> By the way, is there a shortened link to that? from the installer, it's not like you can copy/paste https://wiki.archlinux.org/index.php/Installation_guide#Post-installation.

Not that I know of. So printing it in full is probably the only option, I hope people would search it in their favorite search engine and find it instead of writing off the whole thing.
Maybe we can use a link shortener for this. Also if we do add this. I think it should be fine to change the post install hooks in i3 and sway to just print out a message stating we don't ship a default config 
> Maybe we can use a link shortener for this. Also if we do add this. I think it should be fine to change the post install hooks in i3 and sway to just print out a message stating we don't ship a default config

I just made https://tinyurl.com/archpostinstallwiki but I'm hesitant to have a link to any domain not part of the arch project.
> > Maybe we can use a link shortener for this. Also if we do add this. I think it should be fine to change the post install hooks in i3 and sway to just print out a message stating we don't ship a default config
> 
> I just made https://tinyurl.com/archpostinstallwiki but I'm hesitant to have a link to any domain not part of the arch project.

I second this hesitation ^^ It's almost as long anyway so go with the original link.

Resolving patch:
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1,4 +1,4 @@
-import os, stat, time, shutil, pathlib
+import os, stat, time, shutil, pathlib, subprocess
 
 from .exceptions import *
 from .disk import *
@@ -81,6 +81,7 @@ def __exit__(self, *args, **kwargs):
 		if not (missing_steps := self.post_install_check()):
 			self.log('Installation completed without any errors. You may now reboot.', bg='black', fg='green', level=LOG_LEVELS.Info)
 			self.sync_log_to_install_medium()
+
 			return True
 		else:
 			self.log('Some required steps were not successfully installed/configured before leaving the installer:', bg='black', fg='red', level=LOG_LEVELS.Warning)
@@ -190,6 +191,9 @@ def run_command(self, cmd, *args, **kwargs):
 	def arch_chroot(self, cmd, *args, **kwargs):
 		return self.run_command(cmd)
 
+	def drop_to_shell(self):
+		subprocess.check_call(f"/usr/bin/arch-chroot {self.target}", shell=True)
+
 	def configure_nic(self, nic, dhcp=True, ip=None, gateway=None, dns=None, *args, **kwargs):
 		if dhcp:
 			conf = Networkd(Match={"Name": nic}, Network={"DHCP": "yes"})
diff --git a/examples/guided.py b/examples/guided.py
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -327,3 +327,11 @@ def perform_installation(mountpoint):
 
 ask_user_questions()
 perform_installation_steps()
+
+installation.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
+choice = input("Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] ")
+if choice.lower() in ("y", ""):
+	try:
+		installation.drop_to_shell()
+	except:
+		pass


Test patch: