patch 8.2.2675: directory change in a terminal window shell is not followed

Problem:    Directory change in a terminal window shell is not followed.
Solution:   Add the 'autoshelldir' option. (closes #6290)
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 7fcdfbe..babe721 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -749,6 +749,15 @@
 	or selected.
 	Note: When this option is on some plugins may not work.
 
+			*'autoshelldir'* *'asd'* *'noautoshelldir'* *'noasd'*
+'autoshelldir' 'asd'	boolean (default off)
+			global
+	When on, Vim will change the current working directory whenever you
+	change the directory of the shell running in a terminal window. You
+	need proper setting-up, so whenever the shell's pwd changes an OSC 7
+	escape sequence will be emitted. For example, on Linux, you can source
+	/etc/profile.d/vte.sh in your shell profile if you use bash or zsh.
+
 				*'arabic'* *'arab'* *'noarabic'* *'noarab'*
 'arabic' 'arab'		boolean (default off)
 			local to window
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index c0a070d..ead42f9 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -605,6 +605,7 @@
 'ambiwidth'	  'ambw'    what to do with Unicode chars of ambiguous width
 'antialias'	  'anti'    Mac OS X: use smooth, antialiased fonts
 'autochdir'	  'acd'     change directory to the file in the current window
+'autoshelldir'	  'asd'     change directory to the shell's current directory
 'arabic'	  'arab'    for Arabic as a default second language
 'arabicshape'	  'arshape' do shaping for Arabic characters
 'autoindent'	  'ai'	    take indent for new line from previous line
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 45aa8f9..176f9ea 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -266,6 +266,8 @@
   call <SID>AddOption("autochdir", gettext("change to directory of file in buffer"))
   call <SID>BinOptionG("acd", &acd)
 endif
+call <SID>AddOption("autoshelldir", gettext("change to pwd of shell in terminal buffer"))
+call <SID>BinOptionG("asd", &asd)
 call <SID>AddOption("wrapscan", gettext("search commands wrap around the end of the buffer"))
 call <SID>BinOptionG("ws", &ws)
 call <SID>AddOption("incsearch", gettext("show match for partly typed search command"))