Wickes (UK DIY store) sells stair packs and has general fitting instructions.
These are available on-line. They are too long to summarise here, but do take you through the process step-by-step.
This completely depends on your location, and what codes you follow. The first mention of exhausting to the outdoors I could find in International Residential Code (IRC), was in the 2003 version.
International Residential Code (IRC) 2003
Chapter 15 - Exhaust Systems
SECTION M1506 MECHANICAL VENTILATION
M1506.2 Recirculation of air. Exhaust air from bathrooms and toilet rooms shall not be recirculated within a residence or to another dwelling unit.
In 2006 the code was moved and updated a bit.
International Residential Code (IRC) 2006
Chapter 15 - Exhaust Systems
SECTION M1501 GENERAL
M1501.1 Outdoor discharge. The air removed by every mechanical exhaust system shall be discharged to the outdoors. Air shall not be exhausted into an attic, soffit, ridge vent or crawl space.
Exception: Whole-house ventilation-type attic fans that discharge into the attic space of dwelling units having private attics shall be permitted.
In 2012 they added a reference to another code section.
International Residential Code (IRC) 2012
Chapter 15 - Exhaust Systems
SECTION M1501 GENERAL
M1501.1 Outdoor discharge. The air removed by every mechanical exhaust system shall be discharged to the outdoors in accordance with Section M1506.2. Air shall not be exhausted into an attic, soffit, ridge vent or crawl space.
Exception: Whole-house ventilation-type attic fans that discharge into the attic space of dwelling units having private attics shall be permitted.
SECTION M1506 EXHAUST DUCTS AND EXHAUST OPENINGS
M1506.2 Exhaust openings. Air exhaust openings shall terminate not less than 3 feet (914 mm) from property lines; 3 feet (914 mm) from operable and nonoperable openings into the building and 10 feet (3048 mm) from mechanical air intakes except where the opening is located 3 feet (914 mm) above the air intake. Openings shall comply with Sections R303.5.2 and R303.6.
Chapter 3 - Building Planning
SECTION R303 LIGHT, VENTILATION AND HEATING
R303.5.2 Exhaust openings. Exhaust air shall not be directed onto walkways.
R303.6 Outside opening protection. Air exhaust and intake openings that terminate outdoors shall be protected with corrosion-resistant screens, louvers or grilles having a minimum opening size of 1/4 inch (6 mm) and a maximum opening size of 1/2 inch (13 mm), in any dimension. Openings shall be protected against local weather conditions. Outdoor air exhaust and intake openings shall meet the provisions for exterior wall opening protectives in accordance with this code.
NOTE: It's possible that this requirement existed prior to the 2003 code version, but I was not able to find it. Also note that this is only one building code, and that others do exist.
Thanks to @HerrBag for making me take a second look at 303.3, it appears there is mention of exhausting to the outside in the 2000 version of IRC.
International Residential Code (IRC) 2000
Chapter 3 - Building Planning
SECTION R303 LIGHT, VENTILATION AND HEATING
R303.3 Bathrooms. Bathrooms, water closet compartments and other similar rooms shall be provided with aggregate glazing area in windows of not less than 3 square feet (0.279 m²), one–half of which must be openable.
Exception: The glazed areas shall not be required where artificial light and a mechanical ventilation system are provided. The minimum ventilation rates shall be 50 cfm (23.6 L/s) for intermittent ventilation or 20 cfm (9.4 L/s) for continuous ventilation. Ventilation air from the space shall be exhausted directly to the outside.
Since this is as far back as I've been able to access the IRC (so far), I can only come to the conclusion that it has always been a requirement. At least ever since mechanical ventilation has been an approved bathroom ventilation method.
Best Answer
That handrail does not meet code, because it is not continuous from top to bottom of stairway and the ends do not terminate correctly at the bottom.
The Code (ICC R311.7.7) requires handrails:
1) Height to be between 30” and 38” above the nosing of the tread, and
2) Be continuous on at least one side of a stairway with 4 or more risers and be from a point directly above the top tread to a point directly above the lowest tread. (It can be interrupted at turns,) and
3) The size is to be between 1 1/4” and 2” if it’s round. If it’s not round, then it needs to be 4” or more around but not more than 6”. If it’s bigger than that, it needs finger grips. (It gets complicated because the finger grips are restricted too.)
4) If it’s located next to a wall it shall have a minimum of 1 1/2” clear space to the wall, and
5) The handrail end must terminate to the wall, newel post, or safety terminal. Safety terminal is not defined in the code.
The intention of returning handrails is to keep it from catching someone’s pocket, etc. Btw, we design a lot of handrails and when only one is installed, we prefer it on the right side descending.
The code does not require tube handrails to be capped, as Ed indicated.